From d59e70ce8425b610d1e5a9cde77cfb26af9ba184 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Wed, 20 Sep 2017 11:15:13 +0200 Subject: [PATCH 1/2] TST: update test requirements --- .travis.yml | 2 +- setup.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5f93e2f..391d973 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ install: - pip install -U nose - pip install coveralls - pip install codecov - - pip install requests-mock pytest + - pip install requests-mock - pip install https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.7.0.dev.zip - pip install git+https://github.com/kbandla/pydeep.git - pip install python-magic diff --git a/setup.py b/setup.py index 553666f..5b5d273 100644 --- a/setup.py +++ b/setup.py @@ -26,8 +26,15 @@ setup( 'Topic :: Security', 'Topic :: Internet', ], - test_suite="tests", + test_suite="tests.test_offline", install_requires=['six', 'requests', 'python-dateutil', 'jsonschema'], + tests_require=[ + 'jsonschema', + 'python-dateutil', + 'python-magic', + 'requests-mock', + 'six' + ], include_package_data=True, package_data={'pymisp': ['data/*.json', 'data/misp-objects/schema_objects.json', 'data/misp-objects/schema_relationships.json', From 0790e571a1819f6aaff82005a47132c2b6cd8494 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Wed, 20 Sep 2017 11:15:33 +0200 Subject: [PATCH 2/2] TST: skip test with optional files if not existing --- tests/test_offline.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_offline.py b/tests/test_offline.py index 25229c0..47e43a5 100644 --- a/tests/test_offline.py +++ b/tests/test_offline.py @@ -233,9 +233,12 @@ class TestOffline(unittest.TestCase): def test_objects(self, m): paths = ['cmd.exe', 'tmux', 'MachO-OSX-x64-ls'] - for path in paths: - json_blob = self.make_objects(os.path.join('tests', - 'viper-test-files', 'test_files', path)) + try: + for path in paths: + json_blob = self.make_objects(os.path.join('tests', + 'viper-test-files', 'test_files', path)) + except IOError: # Can be replaced with FileNotFoundError when support for python 2 is dropped + return unittest.SkipTest() print(json_blob) if __name__ == '__main__':