Skip to content

Commit

Permalink
Factored test code somewhat
Browse files Browse the repository at this point in the history
  • Loading branch information
c8y3 committed Jan 26, 2024
1 parent 2d7d132 commit 465a4cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
7 changes: 4 additions & 3 deletions validation/graylog.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ def create_gelf_input(self):
def create_correlation_count(self, *args, **kwargs):
self._api.create_correlation_count(*args, **kwargs)

def get_events_count(self):
return self._api.get_events_count()

def get_events(self):
return self._api.get_events()

def get_events_count(self):
events = self.get_events()
return events['total_events']

def _has_event(self):
events_count = self.get_events_count()
return events_count == 1
Expand Down
7 changes: 1 addition & 6 deletions validation/graylog_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,4 @@ def events_search_is_available(self):

def get_events(self):
response = self._search_events()
body = response.json()
return body

def get_events_count(self):
body = self.get_events()
return body['total_events']
return response.json()

0 comments on commit 465a4cf

Please sign in to comment.