def test_match(): assert match( Command('mkdir foo/bar/baz', '', 'mkdir: foo/bar: No such file or directory'), None) assert not match(Command('mkdir foo/bar/baz', '', ''), None) assert not match(Command('mkdir foo/bar/baz', '', 'foo bar baz'), None) assert not match(Command('', '', ''), None)
def test_not_match(command): assert not match(command)
def test_match(command): assert match(command)
def test_not_match(command): assert not match(command, None)
def test_match(): assert match(Command('mkdir foo/bar/baz', '', 'mkdir: foo/bar: No such file or directory'), None) assert not match(Command('mkdir foo/bar/baz', '', ''), None) assert not match(Command('mkdir foo/bar/baz', '', 'foo bar baz'), None) assert not match(Command('', '', ''), None)
def test_match(): assert match(Command('mkdir foo/bar/baz', stderr='mkdir: foo/bar: No such file or directory'), None)