def test_save_privilege(self): privilege = Privilege("foo-privilege", kind="execute", action="http://example.com/") privilege.create(self.connection) privilege.add_role_name("manage-user") privilege.update(self.connection) assert "manage-user" in privilege.role_names() privilege.delete(self.connection)
def test_save_privilege(self): connection = Connection.make_connection(tc.hostname, tc.admin, tc.password) privilege = Privilege("foo-privilege","http://example.com/","execute") privilege.create(connection) privilege.add_role_name("manage-user") privilege.update(connection) self.assertIn("manage-user", privilege.role_names()) privilege.delete(connection)
def test_create_privilege(self): new_privilege = Privilege("foo-privilege", kind="execute", action="http://example.com/") assert "foo-privilege" == new_privilege.privilege_name() new_privilege.create(self.connection) privileges = Privilege.list(self.connection) assert "execute|foo-privilege" in privileges new_privilege.delete(self.connection)
def test_create_privilege(self): connection = Connection.make_connection(tc.hostname, tc.admin, tc.password) new_privilege = Privilege("foo-privilege","http://example.com/","execute") self.assertEqual(new_privilege.privilege_name(), "foo-privilege") new_privilege.create(connection) privileges = Privilege.list(connection) self.assertIn("execute|foo-privilege", privileges) new_privilege.delete(connection)