当前位置: 首页>>代码示例>>Python>>正文


Python Entity.merge方法代码示例

本文整理汇总了Python中entities.Entity.merge方法的典型用法代码示例。如果您正苦于以下问题:Python Entity.merge方法的具体用法?Python Entity.merge怎么用?Python Entity.merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在entities.Entity的用法示例。


在下文中一共展示了Entity.merge方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_merge_rels

# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import merge [as 别名]
 def test_merge_rels(self):
   entity1 = Entity(serves=['a','b','c'])
   entity2 = Entity(serves=['c','d','e'])
   entity1.merge(entity2)
   serves = ['a', 'b', 'c', 'd', 'e']
   assert len(entity1.data['serves']) == 5
   for i in serves:
     assert i in entity1.data['serves']
开发者ID:srthurman,项目名称:transitland-python-client,代码行数:10,代码来源:test_entity.py

示例2: test_merge_existing_pass

# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import merge [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'
开发者ID:srthurman,项目名称:transitland-python-client,代码行数:10,代码来源:test_entity.py

示例3: test_merge_tags

# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import merge [as 别名]
 def test_merge_tags(self):
   entity1 = Entity()
   entity1.set_tag('foo','bar')
   entity2 = Entity()
   entity2.set_tag('cat','dog')
   entity1.merge(entity2)
   tags = entity1.tags()
   assert tags['foo'] == 'bar'
   assert tags['cat'] == 'dog'
开发者ID:srthurman,项目名称:transitland-python-client,代码行数:11,代码来源:test_entity.py

示例4: test_merge

# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import merge [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
开发者ID:srthurman,项目名称:transitland-python-client,代码行数:12,代码来源:test_entity.py

示例5: test_merge_2

# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import merge [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()
开发者ID:srthurman,项目名称:transitland-python-client,代码行数:17,代码来源:test_entity.py


注:本文中的entities.Entity.merge方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。