def test_can_write_write_everyone_user_read(self): """Test when the everyone sid has w rights""" groups = [ (USER_SID, FILE_GENERIC_READ), (EVERYONE_SID, FILE_GENERIC_WRITE), ] _set_file_attributes(self.valid_path, groups) self.assertTrue(can_write(self.testfile))
def test_can_write_full_everyone(self): """test when everyone has full control.""" groups = [(EVERYONE_SID, FILE_ALL_ACCESS)] _set_file_attributes(self.valid_path, groups) self.assertTrue(can_write(self.testfile))
def test_can_write_full_user(self): """Test when the sid has full control.""" groups = [(USER_SID, FILE_ALL_ACCESS)] _set_file_attributes(self.valid_path, groups) self.assertTrue(can_write(self.testfile))
def test_can_write_read_write_everyone(self): """Test when the everyone sid has rw rights.""" groups = [(EVERYONE_SID, FILE_GENERIC_READ | FILE_GENERIC_WRITE)] _set_file_attributes(self.valid_path, groups) self.assertTrue(can_write(self.testfile))
def test_can_write_read_write_user(self): """Test when the user sid has rw rights.""" # set the file to be read and write just by the user groups = [(USER_SID, FILE_GENERIC_READ | FILE_GENERIC_WRITE)] _set_file_attributes(self.valid_path, groups) self.assertTrue(can_write(self.testfile))
def test_canwrite_no_rights(self): """Test when the sid is not present.""" # remove all the rights from the test file so that # we cannot read or write set_no_rights(self.testfile) self.assertFalse(can_write(self.testfile))