本文整理匯總了Python中dulwich.refs.InfoRefsContainer.keys方法的典型用法代碼示例。如果您正苦於以下問題:Python InfoRefsContainer.keys方法的具體用法?Python InfoRefsContainer.keys怎麽用?Python InfoRefsContainer.keys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dulwich.refs.InfoRefsContainer
的用法示例。
在下文中一共展示了InfoRefsContainer.keys方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_keys
# 需要導入模塊: from dulwich.refs import InfoRefsContainer [as 別名]
# 或者: from dulwich.refs.InfoRefsContainer import keys [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 keys [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 keys [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')))