new: [test] Warninglist import/export

pull/8278/head
Jakub Onderka 2022-04-13 20:41:14 +02:00
parent 9582d59563
commit 9f2d4636a0
1 changed files with 10 additions and 0 deletions

View File

@ -689,6 +689,10 @@ class TestComprehensive(unittest.TestCase):
wl = request(self.admin_misp_connector, 'POST', 'warninglists/add', data=warninglist)
check_response(wl)
exported = request(self.admin_misp_connector, 'GET', f'warninglists/export/{wl["Warninglist"]["id"]}')
self.assertIn('name', exported)
self.assertEqual('Test', exported['name'])
check_response(self.admin_misp_connector.enable_warninglist(wl["Warninglist"]["id"]))
response = self.admin_misp_connector.values_in_warninglist("1.2.3.4")
@ -719,6 +723,12 @@ class TestComprehensive(unittest.TestCase):
response = request(self.admin_misp_connector, 'POST', f'warninglists/delete/{wl["Warninglist"]["id"]}')
check_response(response)
# Create new warninglist by importing under different name
exported["name"] = "Test2"
response = request(self.admin_misp_connector, 'POST', f'warninglists/import', exported)
check_response(response)
print(response)
def test_protected_event(self):
event = create_simple_event()
event = check_response(self.admin_misp_connector.add_event(event))