Beispiel #1
0
    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")
Beispiel #2
0
    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")
Beispiel #3
0
    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")
Beispiel #4
0
    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")
Beispiel #5
0
 def test_eent(self):
     """
     If file doesn't exist, return False.
     """
     assert False is has_file_with("foo", "bar", b"")
Beispiel #6
0
 def test_eent(self):
     """
     If file doesn't exist, return False.
     """
     assert False is has_file_with("foo", "bar", b"")