本文整理汇总了Python中dulwich.refs.InfoRefsContainer.allkeys方法的典型用法代码示例。如果您正苦于以下问题:Python InfoRefsContainer.allkeys方法的具体用法?Python InfoRefsContainer.allkeys怎么用?Python InfoRefsContainer.allkeys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dulwich.refs.InfoRefsContainer
的用法示例。
在下文中一共展示了InfoRefsContainer.allkeys方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_keys
# 需要导入模块: from dulwich.refs import InfoRefsContainer [as 别名]
# 或者: from dulwich.refs.InfoRefsContainer import allkeys [as 别名]
def test_keys(self):
refs = InfoRefsContainer(BytesIO(_TEST_REFS_SERIALIZED))
actual_keys = set(refs.keys())
self.assertEqual(set(refs.allkeys()), actual_keys)
# ignore the symref loop if it exists
actual_keys.discard(b"refs/heads/loop")
expected_refs = dict(_TEST_REFS)
del expected_refs[b"HEAD"]
self.assertEqual(set(expected_refs.keys()), actual_keys)
actual_keys = refs.keys(b"refs/heads")
actual_keys.discard(b"loop")
self.assertEqual([b"40-char-ref-aaaaaaaaaaaaaaaaaa", b"master", b"packed"], sorted(actual_keys))
self.assertEqual([b"refs-0.1", b"refs-0.2"], sorted(refs.keys(b"refs/tags")))
示例2: test_keys
# 需要导入模块: from dulwich.refs import InfoRefsContainer [as 别名]
# 或者: from dulwich.refs.InfoRefsContainer import allkeys [as 别名]
def test_keys(self):
refs = InfoRefsContainer(BytesIO(_TEST_REFS_SERIALIZED))
actual_keys = set(refs.keys())
self.assertEqual(set(refs.allkeys()), actual_keys)
expected_refs = dict(_TEST_REFS)
del expected_refs[b'HEAD']
del expected_refs[b'refs/heads/loop']
self.assertEqual(set(expected_refs.keys()), actual_keys)
actual_keys = refs.keys(b'refs/heads')
actual_keys.discard(b'loop')
self.assertEqual(
[b'40-char-ref-aaaaaaaaaaaaaaaaaa', b'master', b'packed'],
sorted(actual_keys))
self.assertEqual([b'refs-0.1', b'refs-0.2'],
sorted(refs.keys(b'refs/tags')))
示例3: test_keys
# 需要导入模块: from dulwich.refs import InfoRefsContainer [as 别名]
# 或者: from dulwich.refs.InfoRefsContainer import allkeys [as 别名]
def test_keys(self):
refs = InfoRefsContainer(StringIO(_TEST_REFS_SERIALIZED))
actual_keys = set(refs.keys())
self.assertEqual(set(refs.allkeys()), actual_keys)
# ignore the symref loop if it exists
actual_keys.discard('refs/heads/loop')
expected_refs = dict(_TEST_REFS)
del expected_refs['HEAD']
self.assertEqual(set(expected_refs.iterkeys()), actual_keys)
actual_keys = refs.keys('refs/heads')
actual_keys.discard('loop')
self.assertEqual(
['40-char-ref-aaaaaaaaaaaaaaaaaa', 'master', 'packed'],
sorted(actual_keys))
self.assertEqual(['refs-0.1', 'refs-0.2'],
sorted(refs.keys('refs/tags')))