Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Aug 24, 2023
1 parent 5f794b9 commit 975a0f7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/service/test_analyzer_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from unittest.mock import MagicMock

import httpretty
import sure

from app.boosting_decision_making.boosting_decision_maker import BoostingDecisionMaker
from app.commons import launch_objects
Expand Down Expand Up @@ -330,7 +331,7 @@ def test_analyze_logs(self):
]

for idx, test in enumerate(tests):
try:
with sure.ensure('Error in the test case index: {0}', idx):
self._start_server(test["test_calls"])
config = self.get_default_search_config()
app_config = self.app_config
Expand All @@ -356,18 +357,15 @@ def test_analyze_logs(self):
launch.analyzerConfig = test["analyzer_config"]
response = analyzer_service.analyze_logs(launches)

assert len(response) == test["expected_count"]
response.should.have.length_of(test["expected_count"])

if test["expected_issue_type"] != "":
assert response[0].issueType == test["expected_issue_type"]
response[0].issueType.should.equal(test["expected_issue_type"])

if "expected_id" in test:
assert response[0].relevantItem == test["expected_id"]
response[0].relevantItem.should.equal(test["expected_id"])

TestAutoAnalyzerService.shutdown_server(test["test_calls"])
except AssertionError as err:
raise AssertionError(f'Error in the test case number: {idx}'). \
with_traceback(err.__traceback__)


if __name__ == '__main__':
Expand Down

0 comments on commit 975a0f7

Please sign in to comment.