Skip to content

Commit

Permalink
fix: fixes issues added in latest commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cvandeplas committed Aug 12, 2024
1 parent 842f91a commit 1bdb24c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion documentation/migrate_web_json_to_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
# write back to python file
new_moduleinfo_text = ['moduleinfo = {']
for k, v in moduleinfo.items():
new_moduleinfo_text.append(f" '{k}': {repr(v).replace('\\', '\\\\')},")
v_updated = repr(v).replace('\\', '\\\\')
new_moduleinfo_text.append(f" '{k}': {v_updated},")
new_moduleinfo_text.append('}')

python_content_new, cnt = re.subn(re_pattern, '\n'.join(new_moduleinfo_text), python_content, re.MULTILINE | re.DOTALL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def dict_handler(request: dict):
' uuid.')
}

if request['attribute']['type'] not in MISP_ATTRIBUTES['input']:
if request['attribute']['type'] not in mispattributes['input']:
return {'error': 'Unsupported attribute type.'}

event_limit = request['config'].get('event_limit')
Expand Down
7 changes: 5 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def test_introspection_module_init(self):
for module in module_files:
if module not in modules_api:
issues_found.append(f"Missing module {module} in {d}/__init__.py.")
self.assertEqual(issues_found, [], f"Found issues: \n{'\n- '.join(issues_found)}")

error_message = '\n- '.join(issues_found)
self.assertEqual(issues_found, [], f"Found issues: \n{error_message}")
finally:
response.connection.close()

Expand Down Expand Up @@ -88,7 +90,8 @@ def test_introspection_module_structure(self):
continue

sys.path.remove(str(root_path / 'misp_modules' / 'lib'))
self.assertEqual(issues_found, [], f"Found issues: \n{'\n- '.join(issues_found)}")
error_message = '\n- '.join(issues_found)
self.assertEqual(issues_found, [], f"Found issues: \n{error_message}")

def test_cve(self):
with open('tests/bodycve.json', 'r') as f:
Expand Down

0 comments on commit 1bdb24c

Please sign in to comment.