本文整理汇总了Python中dulwich.repo.InfoRefsContainer类的典型用法代码示例。如果您正苦于以下问题:Python InfoRefsContainer类的具体用法?Python InfoRefsContainer怎么用?Python InfoRefsContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InfoRefsContainer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_invalid_refname
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.assertEquals(expected_refs, refs.as_dict())
示例2: test_keys
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")))
示例3: test_keys
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(['master', 'packed'], sorted(actual_keys))
self.assertEqual(['refs-0.1', 'refs-0.2'],
sorted(refs.keys('refs/tags')))
示例4: test_get_peeled
def test_get_peeled(self):
refs = InfoRefsContainer(StringIO(_TEST_REFS_SERIALIZED))
# refs/heads/loop does not show up even if it exists
self.assertEqual(
_TEST_REFS['refs/heads/master'],
refs.get_peeled('refs/heads/master'))
示例5: test_as_dict
def test_as_dict(self):
refs = InfoRefsContainer(StringIO(_TEST_REFS_SERIALIZED))
# refs/heads/loop does not show up even if it exists
expected_refs = dict(_TEST_REFS)
del expected_refs['HEAD']
self.assertEqual(expected_refs, refs.as_dict())