Sha256: a70129174e9f9db0b5ab70a5cf03e55f06264dc16f9042834ed118d775ca2b16

Contents?: true

Size: 1.15 KB

Versions: 7

Compression:

Stored size: 1.15 KB

Contents

from openc3.tools.test_runner.test import Test, TestSuite, SkipTestCase


class ExampleTest(Test):
    def setup(self):
        print("Setup")

    def test_case_with_long_name(self):
        print(
            f"Running {Test.current_test_suite()}:{Test.current_test()}:{Test.current_test_case()}"
        )
        Test.print("This test verifies requirement 1")
        raise RuntimeError("error")
        print("continue past raise")  # NOSONAR

    def test_req2(self):
        print(
            f"Running {Test.current_test_suite()}:{Test.current_test()}:{Test.current_test_case()}"
        )
        Test.print("This test verifies requirement 2")
        self.helper()
        wait(2)

    def test_req3(self):
        print(
            f"Running {Test.current_test_suite()}:{Test.current_test()}:{Test.current_test_case()}"
        )
        raise SkipTestCase

    def helper(self):
        if RunningScript.manual:
            answer = ask("Are you sure?")
        else:
            answer = "y"

    def teardown(self):
        print("teardown")


class MyTestSuite(TestSuite):
    def __init__(self):
        super().__init__()
        self.add_test(ExampleTest)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
openc3-cosmos-demo-6.2.1 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-6.2.0 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-6.1.0 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-6.0.2 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-6.0.1 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-6.0.0 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-5.20.0 targets/INST2/procedures/my_test_suite.py