コード例 #1
0
 def test_NewRelationship(self):
     asset_manager = generate_asset_manager(asset_manager_id=self.asset_manager_id)
     self.asset_managers_interface.new(asset_manager)
     relation = generate_asset_manager(asset_manager_id=self.related_id)
     self.asset_managers_interface.new(relation)
     relationship = generate_relationship(asset_manager_id=self.asset_manager_id,
                                          related_id=self.related_id)
     relationship = self.asset_managers_interface.new_relationship(relationship)
     self.assertEqual(type(relationship), Relationship)
コード例 #2
0
 def test_AmendRelationship(self):
     asset_manager = generate_asset_manager(asset_manager_id=self.asset_manager_id)
     self.asset_managers_interface.new(asset_manager)
     relation = generate_asset_manager(asset_manager_id=self.related_id)
     self.asset_managers_interface.new(relation)
     relationship = generate_relationship(asset_manager_id=self.asset_manager_id,
                                          related_id=self.related_id,
                                          relationship_type='External')
     relationship = self.asset_managers_interface.new_relationship(relationship)
     relationship.relationship_type = 'Employee'
     relationship = self.asset_managers_interface.amend_relationship(relationship)
     self.assertEqual(type(relationship), Relationship)
コード例 #3
0
 def test_RetrieveRelationship(self):
     asset_manager = generate_asset_manager(asset_manager_id=self.asset_manager_id)
     self.asset_managers_interface.new(asset_manager)
     relation = generate_asset_manager(asset_manager_id=self.related_id)
     self.asset_managers_interface.new(relation)
     relationship = generate_relationship(asset_manager_id=self.asset_manager_id,
                                          related_id=self.related_id,
                                          relationship_type='External')
     relationship = self.asset_managers_interface.new_relationship(relationship)
     relationship.relationship_type = 'Employee'
     self.asset_managers_interface.amend_relationship(relationship)
     relations = self.asset_managers_interface.retrieve_relationships(asset_manager_id=self.asset_manager_id)
     self.assertEqual(len(relations), 1)
     self.assertEqual(type(relations[0]), Relationship)
     self.assertEqual(relations[0].relationship_type, 'Employee')