def test_list(self): connection = Connection.make_connection(tc.hostname, tc.admin, tc.password) privileges = Privilege.list(connection) self.assertGreater(len(privileges), 300) self.assertIn("execute|manage-admin", privileges)
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)
def test_list(self): privileges = Privilege.list(self.connection) assert len(privileges) > 300 assert "execute|manage-admin" in privileges