Sha256: f27251dc29efefc919d09e83af73693975d657bc1914110241e88a2df8c5f3be

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 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.puts("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.puts("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 openc3.script.RUNNING_SCRIPT and openc3.script.RUNNING_SCRIPT.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

1 entries across 1 versions & 1 rubygems

Version Path
openc3-cosmos-demo-5.12.0 targets/INST2/procedures/my_test_suite.py