def test_has_same_ownership(self): path1 = os.path.join(self.tempdir, 'test1') path2 = os.path.join(self.tempdir, 'test2') util.safe_open(path1, 'w').close() util.safe_open(path2, 'w').close() self.assertTrue(filesystem.has_same_ownership(path1, path2))
def test_perform_permissions(self): self.auth.prepare() # Remove exec bit from permission check, so that it # matches the file self.auth.perform([self.achall]) self.assertTrue(filesystem.check_mode(self.validation_path, 0o644)) # Check permissions of the directories for dirpath, dirnames, _ in os.walk(self.path): for directory in dirnames: full_path = os.path.join(dirpath, directory) self.assertTrue(filesystem.check_mode(full_path, 0o755)) self.assertTrue(filesystem.has_same_ownership(self.validation_path, self.path))