class EmptyLdapTestCase(TestCase): def setUp(self): self.desired_user = Record(dn='user', attrs={}) self.exporter = LdapExporter(desired=[self.desired_user], current=[]) self.exporter.compile_actions() def test_one_action_is_add(self): self.assertEqual(len(self.exporter.actions), 1) action = self.exporter.actions[0] self.assertIsInstance(action, AddAction)
class EmptyLdapTestCase(TestCase): def setUp(self): self.desired_user = UserRecord(dn='user', attrs={}) self.exporter = LdapExporter(desired=[self.desired_user], current=[]) self.exporter.compile_actions() def test_one_action_is_add(self): self.assertEqual(len(self.exporter.actions), 1) action = self.exporter.actions[0] self.assertIsInstance(action, AddAction)
def build_exporter(self, current=None, desired=None): """Return an LdapExporter from ldap and orm users It does not compile actions. """ if current is None: current = self.initial_ldap_users if desired is None: desired = self.users_to_sync return LdapExporter.from_orm_objects_and_ldap_result( current=current, desired=desired, base_dn=self.base_dn, )
def build_user_exporter(self, current_users=None, desired_users=None): """Return an LdapExporter from ldap and orm users. It does not compile actions. """ if current_users is None: current_users = self.initial_ldap_users if desired_users is None: desired_users = self.users_to_sync return LdapExporter.from_orm_objects_and_ldap_result( db_users=desired_users, ldap_users=current_users, user_base_dn=self.user_base_dn, )
def build_exporter(self): """Return an LdapExporter. It does not compile actions. """ return LdapExporter.from_orm_objects_and_ldap_result( db_users=self.users_to_sync, ldap_users=self.initial_ldap_users, user_base_dn=self.user_base_dn, db_groups=self.groups_to_sync, ldap_groups=self.initial_ldap_groups, group_base_dn=self.group_base_dn, db_properties=self.properties_to_sync, ldap_properties=self.initial_ldap_properties, property_base_dn=self.property_base_dn, )
def setUp(self): self.desired_user = UserRecord(dn='user', attrs={}) self.exporter = LdapExporter(desired=[self.desired_user], current=[]) self.exporter.compile_actions()
def setUp(self): self.desired_user = Record(dn='user', attrs={}) self.exporter = LdapExporter(desired=[self.desired_user], current=[])
def exporter(self, desired_user): return LdapExporter(desired=[desired_user], current=[])
def setUp(self): self.desired_user = Record(dn='user', attrs={}) self.exporter = LdapExporter(desired=[self.desired_user], current=[]) self.exporter.compile_actions()