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()
Exemplo n.º 3
0
    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()
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
    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
Exemplo n.º 6
0
    def test_matches(self):
        check_command_output = CheckCommandOutput(
            [sys.executable, '-c', 'import os;print(\'foo\')'], ['foo', 'bar'])

        matches = check_command_output()
        assert matches == 1