def test_matches(self): check_command_output = CheckCommandOutput( '{} -c "import os;print(\'foo\')"'.format(sys.executable), ['foo', 'bar']) matches = check_command_output() assert matches == 1
def test_no_matches(self): check_command_output = CheckCommandOutput( '{} -c "import os;print(\'foo\')"'.format(sys.executable), ['bar'], attempts=1) with pytest.raises(RetryError): check_command_output()
def test_no_matches(self): check_command_output = CheckCommandOutput( [sys.executable, '-c', 'import os;print(\'foo\')'], ['bar'], attempts=1) with pytest.raises(RetryError): check_command_output()
def test_matches_all_success(self): check_command_output = CheckCommandOutput( '{} -c "import os;print(\'foobar\')"'.format(sys.executable), ['foo', 'bar'], matches='all' ) matches = check_command_output() assert matches == 2
def test_matches_all_success(self): check_command_output = CheckCommandOutput( [sys.executable, '-c', 'import os;print(\'foobar\')'], ['foo', 'bar'], matches='all') matches = check_command_output() assert matches == 2
def test_matches(self): check_command_output = CheckCommandOutput( [sys.executable, '-c', 'import os;print(\'foo\')'], ['foo', 'bar']) matches = check_command_output() assert matches == 1