def setUpClass(cls): cls.schema = SchemaInfo.from_json(edir_8_8_8_schema) info = DsaInfo.from_json(edir_8_8_8_dsa_info, cls.schema) cls.server = Server.from_definition('MockSyncServer', info, cls.schema) cls.connection = Connection(cls.server, user='******', password='******', client_strategy=MOCK_SYNC) # create fixtures cls.connection.strategy.add_entry('cn=user1,ou=test', {'userPassword': '******', 'revision': 1}) cls.connection.strategy.add_entry('cn=user2,ou=test', {'userPassword': '******', 'revision': 2}) cls.connection.strategy.add_entry('cn=user3,ou=test', {'userPassword': '******', 'revision': 3})
def test_json_definition(self): if not self.connection.strategy.pooled: if not self.connection.server.info: self.connection.refresh_server_info() json_info = self.connection.server.info.to_json() json_schema = self.connection.server.schema.to_json() info = DsaInfo.from_json(json_info) schema = SchemaInfo.from_json(json_schema) server1 = Server.from_definition(test_server, info, schema) json_info1 = server1.info.to_json() json_schema1 = server1.schema.to_json() self.assertEqual(json_info, json_info1) self.assertEqual(json_schema, json_schema1)
def setUpClass(cls): cls.schema = SchemaInfo.from_json(edir_9_1_4_schema) info = DsaInfo.from_json(edir_9_1_4_dsa_info, cls.schema) cls.server = Server.from_definition('MockSyncServer', info, cls.schema) cls.connection = Connection(cls.server, user='******', password='******', client_strategy=MOCK_SYNC) # create fixtures cls.connection.strategy.add_entry('cn=user1,ou=test', { 'userPassword': '******', 'revision': 1 }) cls.connection.strategy.add_entry('cn=user2,ou=test', { 'userPassword': '******', 'revision': 2 }) cls.connection.strategy.add_entry('cn=user3,ou=test', { 'userPassword': '******', 'revision': 3 })