From dfa63c9ce25c85911047674c299afd09124b8120 Mon Sep 17 00:00:00 2001 From: Mikhail Itkin Date: Fri, 4 Dec 2015 02:05:05 +0100 Subject: [PATCH 1/2] Add `behave` dependency for test Add `behave` package to the test_requires section of the `setup.py` This allows to split testing dependencies from installation dependencies. Behave is used to run integration functional tests --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6a2b50a0..a77ad75e 100644 --- a/setup.py +++ b/setup.py @@ -69,7 +69,8 @@ os.path.join('etc', 'eps_avhrrl1b_6.5.xml')])], zip_safe=False, install_requires=requires, - test_requires=["mock"], + test_requires=["mock", + 'behave'], extras_require={'xRIT': ['mipp >= 0.6.0'], 'hdf_eos': ['pyhdf'], 'viirs': ['h5py'], From 677df2c70b37a02788b669ae2a258b80b4b23b9f Mon Sep 17 00:00:00 2001 From: Mikhail Itkin Date: Fri, 4 Dec 2015 02:07:00 +0100 Subject: [PATCH 2/2] Add `behave` features and steps files `features` folder contains feature descriptions, files with the extension `.feature`. They provide software specification in the human language. `steps` folder contains `*.py` files with feature implementation. NB. it is a good practice to re-use feature steps in order to skip adding identical steps to different scenarios. E.g. 'when data is available' step will be the same for all features that mention it. --- features/feature-io-api.feature | 25 +++++++++++++++++++++++++ features/steps/steps-io-api.py | 16 ++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 features/feature-io-api.feature create mode 100644 features/steps/steps-io-api.py diff --git a/features/feature-io-api.feature b/features/feature-io-api.feature new file mode 100644 index 00000000..6e55453e --- /dev/null +++ b/features/feature-io-api.feature @@ -0,0 +1,25 @@ +Feature: Simple and intuitive scene loading + + The scientific user explores the data and prototypes new algorithms. + It needs access not only to the calibrated data, + but also to the raw data and probably a majority of the metadata. + The user would work with data locally, and it has to be easy to tell mpop2 where the data is. + Providing filename templates or editing config file before starting working is a pain, so it should be avoided. + + To load the data should be a simple 1-step procedure. + At load time, the user provides the data and metadata he/she needs, + and if some items are unavailable/unaccessible, + the user should be informed in a gentle but clear way (ie. no crash). + The data and metadata available from the file have to be explorable, + so that the user don’t need to guess what the (meta)data is called. + + Scenario: 1-step data loading + Given data is available + When user loads the data without providing a config file + Then scene is returned + + Scenario: No crash when metadata is missing + Given data is available + When user loads the data without providing a config file + And some items are no available + Then scene is returned diff --git a/features/steps/steps-io-api.py b/features/steps/steps-io-api.py new file mode 100644 index 00000000..fa028978 --- /dev/null +++ b/features/steps/steps-io-api.py @@ -0,0 +1,16 @@ +@given(u'data is available') +def step_impl(context): + assert False + +@when(u'user loads the data without providing a config file') +def step_impl(context): + assert False + +@then(u'scene is returned') +def step_impl(context): + assert False + +@when(u'some items are no available') +def step_impl(context): + assert False +