12
12
13
13
# noinspection PyMethodMayBeStatic
14
14
class RunTests (unittest .TestCase ):
15
+ current_file = os .path .basename (__file__ )
15
16
current_folder = os .path .dirname (os .path .realpath (__file__ ))
16
17
17
18
def tearDown (self ):
@@ -23,7 +24,7 @@ def test_01_run_simple_command(self):
23
24
assert result .log_file is None , 'No log file should be generated if wait=True.'
24
25
assert result .complete is True , 'Complete should be true when process execution is complete.'
25
26
assert result .duration < 1 , 'Process duration took too much time.'
26
- assert 'run_tests.py' in result .output , 'Listing do not return correct output.'
27
+ assert self . current_file in result .output , 'Listing do not return correct output.'
27
28
28
29
def test_02_run_command_with_redirect (self ):
29
30
out_file = os .path .join (Settings .TEST_OUT_HOME , 'log.txt' )
@@ -33,7 +34,7 @@ def test_02_run_command_with_redirect(self):
33
34
assert result .complete is True , 'Complete should be true when process execution is complete.'
34
35
assert result .duration < 1 , 'Process duration took too much time.'
35
36
assert result .output == '' , 'Output should be empty.'
36
- assert 'run_tests.py' in File .read (path = out_file )
37
+ assert self . current_file in File .read (path = out_file )
37
38
38
39
def test_03_run_command_with_pipe (self ):
39
40
result = run (cmd = 'echo "test case" | wc -w ' , wait = True , timeout = 1 )
0 commit comments