From 622a5701ee7e2b799d267d4012c295fcbd86f8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 27 Jul 2017 17:14:49 +0200 Subject: [PATCH] Fix typo in variable name. --- pymisp/api.py | 4 ++-- pymisp/mispevent.py | 12 ++++++------ tests/test_offline.py | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pymisp/api.py b/pymisp/api.py index d68472a..81a62ee 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -101,7 +101,7 @@ class PyMISP(object): warnings.warn("You turned on Async, but don't have requests_futures installed") self.asynch = False - self.ressources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') + self.resources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') if out_type != 'json': raise PyMISPError('The only output type supported by PyMISP is JSON. If you still rely on XML, use PyMISP v2.4.49') if debug is not None: @@ -136,7 +136,7 @@ class PyMISP(object): if not self.describe_types.get('sane_defaults'): raise PyMISPError('The MISP server your are trying to reach is outdated (<2.4.52). Please use PyMISP v2.4.51.1 (pip install -I PyMISP==v2.4.51.1) and/or contact your administrator.') except Exception: - with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f: + with open(os.path.join(self.resources_path, 'describeTypes.json'), 'r') as f: describe_types = json.load(f) self.describe_types = describe_types['result'] diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 739630e..b022052 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -52,8 +52,8 @@ class MISPAttribute(object): def __init__(self, describe_types=None): if not describe_types: - self.ressources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') - with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f: + self.resources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') + with open(os.path.join(self.resources_path, 'describeTypes.json'), 'r') as f: t = json.load(f) describe_types = t['result'] self.describe_types = describe_types @@ -289,15 +289,15 @@ def _int_to_str(d): class MISPEvent(object): def __init__(self, describe_types=None, strict_validation=False): - self.ressources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') + self.resources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') if strict_validation: - with open(os.path.join(self.ressources_path, 'schema.json'), 'r') as f: + with open(os.path.join(self.resources_path, 'schema.json'), 'r') as f: self.json_schema = json.load(f) else: - with open(os.path.join(self.ressources_path, 'schema-lax.json'), 'r') as f: + with open(os.path.join(self.resources_path, 'schema-lax.json'), 'r') as f: self.json_schema = json.load(f) if not describe_types: - with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f: + with open(os.path.join(self.resources_path, 'describeTypes.json'), 'r') as f: t = json.load(f) describe_types = t['result'] self.describe_types = describe_types diff --git a/tests/test_offline.py b/tests/test_offline.py index 92f7a5c..ade3d4d 100644 --- a/tests/test_offline.py +++ b/tests/test_offline.py @@ -25,8 +25,8 @@ class TestOffline(unittest.TestCase): self.event = {'Event': json.load(f)} with open('tests/new_misp_event.json', 'r') as f: self.new_misp_event = {'Event': json.load(f)} - self.ressources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../pymisp/data') - with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f: + self.resources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../pymisp/data') + with open(os.path.join(self.resources_path, 'describeTypes.json'), 'r') as f: self.types = json.load(f) with open('tests/sharing_groups.json', 'r') as f: self.sharing_groups = json.load(f) @@ -155,12 +155,12 @@ class TestOffline(unittest.TestCase): p = MockPyMISP(self.domain, self.key) evt = p.get(1) self.assertEqual(3, p.add_hashes(evt, md5='68b329da9893e34099c7d8ad5cb9c940', - sha1='adc83b19e793491b1c6ea0fd8b46cd9f32e592fc', - sha256='01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b', - filename='foobar.exe')) + sha1='adc83b19e793491b1c6ea0fd8b46cd9f32e592fc', + sha256='01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b', + filename='foobar.exe')) self.assertEqual(3, p.add_hashes(evt, md5='68b329da9893e34099c7d8ad5cb9c940', - sha1='adc83b19e793491b1c6ea0fd8b46cd9f32e592fc', - sha256='01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b')) + sha1='adc83b19e793491b1c6ea0fd8b46cd9f32e592fc', + sha256='01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b')) p.av_detection_link(evt, 'https://foocorp.com') p.add_detection_name(evt, 'WATERMELON') p.add_filename(evt, 'foobar.exe')