def test_error_reading_mount_points(self, tmpdir, caplog): e = PyEncfs("--paranoia") assert e.create(tmpdir + "/e", tmpdir + "/d", "PASSWORD") assert e._isencfsmount(tmpdir + "/d") with mock.patch("psutil.disk_partitions", mock.MagicMock(return_value={})): assert not e._isencfsmount(tmpdir + "/d") assert e.umount(tmpdir + "/d") assert "Error identifying mount point" in caplog.text
def test_path_is_encfs_mount(self, tmpdir, caplog): caplog.set_level(logging.DEBUG) e = PyEncfs("--paranoia") assert e.create(tmpdir + "/e", tmpdir + "/d", "PASSWORD") assert e._isencfsmount(tmpdir + "/d") assert "Identified mountpoint" in caplog.text assert e.umount(tmpdir + "/d")
def test_path_is_not_encfs(self, caplog): e = PyEncfs("--paranoia") assert not e._isencfsmount("/") assert "is not of type encfs" in caplog.text
def test_path_is_no_mountpoint(self, tmpdir, caplog): e = PyEncfs("--paranoia") assert not e._isencfsmount(tmpdir) assert "Given path is no mount point" in caplog.text