def test_match(script, stderr): assert match(Command(script, stderr=stderr), None)
def test_match(script, output): assert match(Command(script, output))
def test_match(): assert match(Mock(script='cp dir', stderr="cp: omitting directory 'dir'"), None) assert not match(Mock(script='some dir', stderr="cp: omitting directory 'dir'"), None) assert not match(Mock(script='cp dir', stderr=""), None)
def test_not_match(script, output): assert not match(Command(script, output))
def test_not_match(script, stderr): assert not match(Command(script, stderr=stderr))