Skip to content

Commit

Permalink
fix: tests are passing fine now
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Aug 21, 2018
1 parent 11aaebb commit 47fc0ac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/testlive_comprehensive.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def environment(self):
first_event.add_attribute('text', str(uuid4()))
first_event.attributes[0].add_tag('admin_only')
first_event.attributes[0].add_tag('tlp:white___test')
first_event.add_attribute('text', str(uuid4()))
first_event.attributes[1].add_tag('unique___test')

second_event = MISPEvent()
second_event.info = 'Second event - org only - medium - ongoing'
Expand Down Expand Up @@ -178,7 +180,7 @@ def test_search_type_attribute(self):
# Search as admin
attributes = self.admin_misp_connector.search(controller='attributes',
timestamp=first.timestamp.timestamp())
self.assertEqual(len(attributes), 7)
self.assertEqual(len(attributes), 8)
for a in attributes:
self.assertIn(a.event_id, [first.id, second.id, third.id])
# Search as user
Expand Down Expand Up @@ -266,9 +268,10 @@ def test_search_tag_advanced_event(self):
for a in e.attributes:
self.assertEqual([t for t in a.tags if t.name == 'foo_double___test'], [])

complex_query = self.admin_misp_connector.build_complex_query(not_parameters=['tlp:white___test'])
complex_query = self.admin_misp_connector.build_complex_query(or_parameters=['unique___test'],
not_parameters=['tlp:white___test'])
events = self.admin_misp_connector.search(tags=complex_query)
self.assertEqual(len(events), 2)
self.assertEqual(len(events), 1)
for e in events:
self.assertIn(e.id, [first.id, second.id])
for a in e.attributes:
Expand Down

0 comments on commit 47fc0ac

Please sign in to comment.