port python2.x code to python3.x
[tools/itest-core.git] / tests / functional / test_setup_teardown.py
1 from .base import TestBase, CASES_PATH, cd
2
3
4 class SetupTeardownTest(TestBase):
5
6     @cd(CASES_PATH)
7     def test_setup_always_run(self):
8         self.assertWithText(["-vv", "setup.xml"],
9                             "This message only appears in setup section")
10
11     @cd(CASES_PATH)
12     def test_teardown_always_run(self):
13         self.assertWithText(["-vv", "teardown.xml"],
14                             "This message only appears in teardown section")
15
16     @cd(CASES_PATH)
17     def test_steps_wont_run_if_setup_failed(self):
18         self.assertWithoutText(["-vv", "setup_failed.xml"],
19                                "This message only appears in steps section")
20
21     @cd(CASES_PATH)
22     def test_vars_in_setup_can_be_saw_in_steps(self):
23         self.assertPass("vars_in_setup.xml")
24
25     @cd(CASES_PATH)
26     def test_vars_in_setup_can_be_saw_in_teardown(self):
27         self.assertWithText(["-vv", "vars_in_setup.xml"],
28                             "value of a is 1")