Sha256: 86620da55144d8d0fbb4fd02200697be408853962433ddd1db2b9fdcba0fc285

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 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_2(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_3(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

6 entries across 6 versions & 1 rubygems

Version Path
openc3-cosmos-demo-5.19.0 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-5.18.0 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-5.17.1 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-5.17.0 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-5.16.0 targets/INST2/procedures/my_test_suite.py
openc3-cosmos-demo-5.15.2 targets/INST2/procedures/my_test_suite.py