def test_grant_and_revoke(self):
        self.assertFalse('edit_user' in self.role.capabilities)
        self.role.grant('edit_user')
        self.role.refresh()
        self.assertTrue('edit_user' in self.role.capabilities)

        self.assertFalse('change_own_password' in self.role.capabilities)
        self.role.grant('change_own_password')
        self.role.refresh()
        self.assertTrue('edit_user' in self.role.capabilities)
        self.assertTrue('change_own_password' in self.role.capabilities)

        self.role.revoke('edit_user')
        self.role.refresh()
        self.assertFalse('edit_user' in self.role.capabilities)
        self.assertTrue('change_own_password' in self.role.capabilities)

        self.role.revoke('change_own_password')
        self.role.refresh()
        self.assertFalse('edit_user' in self.role.capabilities)
        self.assertFalse('change_own_password' in self.role.capabilities)
dataset/ETHPy150Open splunk/splunk-sdk-python/tests/test_role.py/RoleTestCase.test_grant_and_revoke/original