本文整理汇总了Python中entities.Entity.add_identifier方法的典型用法代码示例。如果您正苦于以下问题:Python Entity.add_identifier方法的具体用法?Python Entity.add_identifier怎么用?Python Entity.add_identifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entities.Entity
的用法示例。
在下文中一共展示了Entity.add_identifier方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_merge_existing_pass
# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import add_identifier [as 别名]
def test_merge_existing_pass(self):
entity1 = Entity()
entity1.add_identifier('abc')
entity2 = Entity()
entity2.add_identifier('abc')
entity1.merge(entity2)
assert len(entity1.identifiers()) == 1
assert entity1.identifiers()[0] == 'abc'
示例2: test_add_identifier
# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import add_identifier [as 别名]
def test_add_identifier(self):
data = ['abc', 'def']
entity = Entity()
for k in data:
entity.add_identifier(k)
assert len(entity.identifiers()) == 2
for i in entity.identifiers():
assert i in data
示例3: test_merge
# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import add_identifier [as 别名]
def test_merge(self):
data = ['abc', 'def']
entity1 = Entity()
entity1.add_identifier('abc')
entity2 = Entity()
entity2.add_identifier('def')
entity1.merge(entity2)
assert len(entity1.identifiers()) == 2
for i in entity1.identifiers():
assert i in data
示例4: test_merge_2
# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import add_identifier [as 别名]
def test_merge_2(self):
data = ['abc', 'def']
entity1 = Entity(
name='abc',
geometry=1
)
entity1.add_identifier('abc')
entity2 = Entity(
name='def',
geometry=2
)
entity2.add_identifier('def')
entity1.merge(entity2)
assert entity1.name() == entity2.name()
assert entity1.geometry() == entity2.geometry()
示例5: test_merge_existing
# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import add_identifier [as 别名]
def test_merge_existing(self):
entity1 = Entity()
entity1.add_identifier('abc')
entity2 = Entity()
entity2.add_identifier('abc')