aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_reports_collection.py
blob: 8491b91f4093610e9c8bb0e83cb93da2911edef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from onaptests.steps.reports_collection import Report, ReportsCollection, ReportStepStatus


def test_reports_collection():
    rc = ReportsCollection()
    assert rc.report == []

    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