本文整理匯總了Python中dulwich.refs.InfoRefsContainer.as_dict方法的典型用法代碼示例。如果您正苦於以下問題:Python InfoRefsContainer.as_dict方法的具體用法?Python InfoRefsContainer.as_dict怎麽用?Python InfoRefsContainer.as_dict使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dulwich.refs.InfoRefsContainer
的用法示例。
在下文中一共展示了InfoRefsContainer.as_dict方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_invalid_refname
# 需要導入模塊: from dulwich.refs import InfoRefsContainer [as 別名]
# 或者: from dulwich.refs.InfoRefsContainer import as_dict [as 別名]
def test_invalid_refname(self):
text = _TEST_REFS_SERIALIZED + b'00' * 20 + b'\trefs/stash\n'
refs = InfoRefsContainer(BytesIO(text))
expected_refs = dict(_TEST_REFS)
del expected_refs[b'HEAD']
expected_refs[b'refs/stash'] = b'00' * 20
self.assertEqual(expected_refs, refs.as_dict())
示例2: test_invalid_refname
# 需要導入模塊: from dulwich.refs import InfoRefsContainer [as 別名]
# 或者: from dulwich.refs.InfoRefsContainer import as_dict [as 別名]
def test_invalid_refname(self):
text = _TEST_REFS_SERIALIZED + '00' * 20 + '\trefs/stash\n'
refs = InfoRefsContainer(StringIO(text))
expected_refs = dict(_TEST_REFS)
del expected_refs['HEAD']
expected_refs["refs/stash"] = "00" * 20
self.assertEqual(expected_refs, refs.as_dict())
示例3: test_as_dict
# 需要導入模塊: from dulwich.refs import InfoRefsContainer [as 別名]
# 或者: from dulwich.refs.InfoRefsContainer import as_dict [as 別名]
def test_as_dict(self):
refs = InfoRefsContainer(BytesIO(_TEST_REFS_SERIALIZED))
# refs/heads/loop does not show up even if it exists
expected_refs = dict(_TEST_REFS)
del expected_refs[b'HEAD']
del expected_refs[b'refs/heads/loop']
self.assertEqual(expected_refs, refs.as_dict())