from testsolar_testtool_sdk.model.testresult import TestResult, TestCase, ResultType
from datetime import datetime


def test_is_final():
    tr = TestResult(
        test=TestCase("aa", {}),
        start_time=datetime.now(),
        result_type=ResultType.FAILED,
        message="Test failed",
        end_time=datetime.now(),
        steps=[]
    )

    assert tr.is_final()


def test_is_not_final():
    tr = TestResult(
        test=TestCase("aa", {}),
        start_time=datetime.now(),
        result_type=ResultType.RUNNING,
        message="Test failed",
        end_time=datetime.now(),
        steps=[]
    )

    assert not tr.is_final()
