mirror of https://github.com/MISP/PyMISP
chg: Re-enable a few test cases
parent
b802e202e2
commit
f133cb9477
|
@ -421,7 +421,7 @@ class ExpandedPyMISP(PyMISP):
|
|||
response = self._prepare_request('POST', f'attributes/delete/{attribute_id}')
|
||||
response = self._check_response(response, expect_json=True)
|
||||
if ('errors' in response and response['errors'][0] == 403
|
||||
and response['errors'][1]['message'] == 'Attribute not found or not authorised.'):
|
||||
and response['errors'][1]['message'] == 'You do not have permission to do that.'):
|
||||
# FIXME: https://github.com/MISP/MISP/issues/4913
|
||||
# At this point, we assume the user tried to delete an attribute on an event they don't own
|
||||
# Re-try with a proposal
|
||||
|
|
|
@ -517,9 +517,8 @@ class TestComprehensive(unittest.TestCase):
|
|||
obj.add_attribute('filename', 'foo')
|
||||
first.add_object(obj)
|
||||
first = self.user_misp_connector.add_event(first)
|
||||
# FIXME: https://github.com/MISP/MISP/issues/5060
|
||||
# r = self.user_misp_connector.delete_attribute(first.attributes[0].uuid)
|
||||
# self.assertEqual(r['message'], 'Attribute deleted.')
|
||||
r = self.user_misp_connector.delete_attribute(first.attributes[0].uuid)
|
||||
self.assertEqual(r['message'], 'Attribute deleted.')
|
||||
r = self.user_misp_connector.delete_object(first.objects[0].uuid)
|
||||
self.assertEqual(r['message'], 'Object deleted')
|
||||
r = self.user_misp_connector.delete_event(first.uuid)
|
||||
|
@ -1491,9 +1490,8 @@ class TestComprehensive(unittest.TestCase):
|
|||
self.assertTrue(isinstance(attribute, MISPShadowAttribute), attribute)
|
||||
self.assertEqual(attribute.value, second.attributes[0].value)
|
||||
# Delete attribute owned by someone else
|
||||
# FIXME: https://github.com/MISP/MISP/issues/5060
|
||||
# response = self.user_misp_connector.delete_attribute(second.attributes[1])
|
||||
# self.assertTrue(response['success'])
|
||||
response = self.user_misp_connector.delete_attribute(second.attributes[1])
|
||||
self.assertTrue(response['success'])
|
||||
# Delete attribute owned by user
|
||||
response = self.admin_misp_connector.delete_attribute(second.attributes[1])
|
||||
self.assertEqual(response['message'], 'Attribute deleted.')
|
||||
|
@ -1603,7 +1601,7 @@ class TestComprehensive(unittest.TestCase):
|
|||
self.assertEqual(list(users_stats.keys()), ['flatData', 'treemap'])
|
||||
|
||||
users_stats = self.admin_misp_connector.users_statistics(context='attributehistogram')
|
||||
self.assertTrue(isinstance(users_stats, dict), users_stats)
|
||||
self.assertTrue(isinstance(users_stats, list), users_stats)
|
||||
|
||||
self.user_misp_connector.add_sighting({'value': first.attributes[0].value})
|
||||
users_stats = self.user_misp_connector.users_statistics(context='sightings')
|
||||
|
|
Loading…
Reference in New Issue