fix: fixes issues added in latest commit

pull/681/head
Christophe Vandeplas 2024-08-12 11:34:13 +02:00
parent 842f91a4db
commit 1bdb24c9bc
No known key found for this signature in database
GPG Key ID: BDC48619FFDC5A5B
3 changed files with 8 additions and 4 deletions

View File

@ -80,7 +80,8 @@ if __name__ == '__main__':
# 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)

View File

@ -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')

View File

@ -47,7 +47,9 @@ class TestModules(unittest.TestCase):
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()
@ -88,7 +90,8 @@ class TestModules(unittest.TestCase):
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: