diff options
author | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2020-11-03 15:25:58 +0000 |
---|---|---|
committer | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2020-11-04 17:23:40 +0000 |
commit | eeeb7190de7185c9994e460cc0472e8817ab68aa (patch) | |
tree | a6385b3748f32b583b326abf016c1b8628bac254 /tests/test_reports_collection.py | |
parent | 31dc9d07a9bd5c98304ae7d58e995321d3e1507f (diff) |
Integration tests report enrichment
Improve the step description for better reporting
Add duration step in pythonsdk-test reporting
Issue-ID: TEST-271
Issue-ID: TEST-272
Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl>
Change-Id: I6d46cb38ae236bc578eb15982c2c0b8f2b0c0791
Diffstat (limited to 'tests/test_reports_collection.py')
-rw-r--r-- | tests/test_reports_collection.py | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/tests/test_reports_collection.py b/tests/test_reports_collection.py index 264b6b4..8491b91 100644 --- a/tests/test_reports_collection.py +++ b/tests/test_reports_collection.py @@ -1,10 +1,34 @@ -from onaptests.steps.reports_collection import ReportsCollection +from onaptests.steps.reports_collection import Report, ReportsCollection, ReportStepStatus def test_reports_collection(): rc = ReportsCollection() - assert rc.report == {} + assert rc.report == [] - rc.put({"a": "b"}) - assert rc.report == {"a": "b"} + rc.put(Report( + "test", + ReportStepStatus.PASS, + 0.0 + )) + assert len(rc.report) == 1 + + +def test_reports_collection_failed_steps_num(): + + rc = ReportsCollection() + assert rc.failed_steps_num == 0 + + rc.put(Report( + "test", + ReportStepStatus.PASS, + 0.0 + )) + assert rc.failed_steps_num == 0 + + rc.put(Report( + "test", + ReportStepStatus.FAIL, + 0.0 + )) + assert rc.failed_steps_num == 1 |