def create_resolvers_and_realm(self, resolver_data): """Test the connection with the corresponding button in the UI. Return the number of found users. """ driver = self.driver created_resolvers = [] total_expected_users = 0 realmMgr = RealmManager(self) realmMgr.clear_realms() m = UserIdResolverManager(self) m.clear_resolvers() for d in resolver_data: expected_users = d['expected_users'] m.open() r = m.create_resolver(d) m.test_connection(d['name'], expected_users) created_resolvers.append(r) total_expected_users += expected_users realm_name = "SE_realm1" realmMgr.create(realm_name, created_resolvers) user_view = UserView(driver, self.base_url, realm_name) self.assertEqual(total_expected_users, user_view.get_num_users(), "Not the expected number of users")
def test_clear_realms(self): r = RealmManager(self) r.clear_realms() r.close() m = UserIdResolverManager(self) m.clear_resolvers() resolver_data = data.musicians_ldap_resolver m.create_resolver(resolver_data) r.create("test_clear_realm", resolver_data['name']) realms = r.get_realms_list() self.assertEqual(len(realms), 1, "Realm count should be 1") r.clear_realms() realms = r.get_realms_list() self.assertEqual(len(realms), 0, "Realm count should be 0")