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


Python DiskObjectStore.add_alternate_path方法代码示例

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


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

示例1: test_add_alternate_path

# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import add_alternate_path [as 别名]
 def test_add_alternate_path(self):
     store = DiskObjectStore(self.store_dir)
     self.assertEquals([], store._read_alternate_paths())
     store.add_alternate_path("/foo/path")
     self.assertEquals(["/foo/path"], store._read_alternate_paths())
     store.add_alternate_path("/bar/path")
     self.assertEquals(
         ["/foo/path", "/bar/path"],
         store._read_alternate_paths())
开发者ID:Mistobaan,项目名称:dulwich,代码行数:11,代码来源:test_object_store.py

示例2: test_add_alternate_path

# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import add_alternate_path [as 别名]
 def test_add_alternate_path(self):
     store = DiskObjectStore(self.store_dir)
     self.assertEqual([], list(store._read_alternate_paths()))
     store.add_alternate_path(b'/foo/path')
     self.assertEqual([b'/foo/path'], list(store._read_alternate_paths()))
     store.add_alternate_path(b'/bar/path')
     self.assertEqual(
         [b'/foo/path', b'/bar/path'],
         list(store._read_alternate_paths()))
开发者ID:mmahmedgithub,项目名称:dulwich,代码行数:11,代码来源:test_object_store.py

示例3: test_alternates

# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import add_alternate_path [as 别名]
 def test_alternates(self):
     alternate_dir = tempfile.mkdtemp()
     self.addCleanup(shutil.rmtree, alternate_dir)
     alternate_store = DiskObjectStore(alternate_dir)
     b2 = make_object(Blob, data="yummy data")
     alternate_store.add_object(b2)
     store = DiskObjectStore(self.store_dir)
     self.assertRaises(KeyError, store.__getitem__, b2.id)
     store.add_alternate_path(alternate_dir)
     self.assertEquals(b2, store[b2.id])
开发者ID:Mistobaan,项目名称:dulwich,代码行数:12,代码来源:test_object_store.py

示例4: test_rel_alternative_path

# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import add_alternate_path [as 别名]
 def test_rel_alternative_path(self):
     alternate_dir = tempfile.mkdtemp()
     self.addCleanup(shutil.rmtree, alternate_dir)
     alternate_store = DiskObjectStore(alternate_dir)
     b2 = make_object(Blob, data="yummy data")
     alternate_store.add_object(b2)
     store = DiskObjectStore(self.store_dir)
     self.assertRaises(KeyError, store.__getitem__, b2.id)
     store.add_alternate_path(os.path.relpath(alternate_dir, self.store_dir))
     self.assertEqual(list(alternate_store), list(store.alternates[0]))
     self.assertIn(b2.id, store)
     self.assertEqual(b2, store[b2.id])
开发者ID:AaronO,项目名称:dulwich,代码行数:14,代码来源:test_object_store.py

示例5: test_alternates

# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import add_alternate_path [as 别名]
 def test_alternates(self):
     alternate_dir = tempfile.mkdtemp()
     if not isinstance(alternate_dir, bytes):
         alternate_dir = alternate_dir.encode(sys.getfilesystemencoding())
     self.addCleanup(shutil.rmtree, alternate_dir)
     alternate_store = DiskObjectStore(alternate_dir)
     b2 = make_object(Blob, data=b"yummy data")
     alternate_store.add_object(b2)
     store = DiskObjectStore(self.store_dir)
     self.assertRaises(KeyError, store.__getitem__, b2.id)
     store.add_alternate_path(alternate_dir)
     self.assertIn(b2.id, store)
     self.assertEqual(b2, store[b2.id])
开发者ID:mmahmedgithub,项目名称:dulwich,代码行数:15,代码来源:test_object_store.py


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