def test_error(self, tmpdir): """ If opening/reading fails with a differnt error, propate. """ f = tmpdir.join("test") f.write(b"foo") f.chmod(0) with pytest.raises(PermissionError): has_file_with("/", str(f), "foo")
def test_exists(self, tmpdir, content, has): """ If file contains content, return True, ealse False. """ f = tmpdir.join("test") f.write(content) assert has is has_file_with("/", str(f), b"foo")
def test_eent(self): """ If file doesn't exist, return False. """ assert False is has_file_with("foo", "bar", b"")