當前位置: 首頁>>代碼示例>>Python>>正文


Python repo.InfoRefsContainer類代碼示例

本文整理匯總了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())
開發者ID:Mistobaan,項目名稱:dulwich,代碼行數:7,代碼來源:test_repository.py

示例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")))
開發者ID:AaronO,項目名稱:dulwich,代碼行數:14,代碼來源:test_repository.py

示例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')))
開發者ID:Mistobaan,項目名稱:dulwich,代碼行數:15,代碼來源:test_repository.py

示例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'))
開發者ID:Mistobaan,項目名稱:dulwich,代碼行數:6,代碼來源:test_repository.py

示例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())
開發者ID:Mistobaan,項目名稱:dulwich,代碼行數:6,代碼來源:test_repository.py


注:本文中的dulwich.repo.InfoRefsContainer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。