/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/git/tests/test_transportgit.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-10-13 19:04:34 UTC
  • mfrom: (7129.1.3 alpha-fix-git-python3)
  • Revision ID: breezy.the.bot@gmail.com-20181013190434-c34tfdfkqh653h0v
Fix reading of packed refs on Python 3.

Merged from https://code.launchpad.net/~jelmer/brz/alpha-fix-git-python3/+merge/356037

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from dulwich.objects import Blob
22
22
from dulwich.tests.test_object_store import PackBasedObjectStoreTests
 
23
from dulwich.tests.test_refs import RefsContainerTests
23
24
from dulwich.tests.utils import make_object
24
25
 
25
26
from ...tests import TestCaseWithTransport
26
27
 
27
 
from ..transportgit import TransportObjectStore
 
28
from ..transportgit import (
 
29
    TransportObjectStore,
 
30
    TransportRefsContainer,
 
31
    )
28
32
 
29
33
 
30
34
class TransportObjectStoreTests(PackBasedObjectStoreTests, TestCaseWithTransport):
68
72
 
69
73
# FIXME: Unfortunately RefsContainerTests requires on a specific set of refs existing.
70
74
 
71
 
# class TransportRefContainerTests(RefsContainerTests, TestCaseWithTransport):
72
 
#
73
 
#    def setUp(self):
74
 
#        TestCaseWithTransport.setUp(self)
75
 
#        self._refs = TransportRefsContainer(self.get_transport())
 
75
class TransportRefContainerTests(TestCaseWithTransport):
 
76
 
 
77
   def setUp(self):
 
78
       TestCaseWithTransport.setUp(self)
 
79
       self._refs = TransportRefsContainer(self.get_transport())
 
80
 
 
81
   def test_packed_refs_missing(self):
 
82
        self.assertEqual({}, self._refs.get_packed_refs())
 
83
 
 
84
   def test_packed_refs(self):
 
85
        self.get_transport().put_bytes_non_atomic('packed-refs',
 
86
                b'# pack-refs with: peeled fully-peeled sorted \n'
 
87
                b'2001b954f1ec392f84f7cec2f2f96a76ed6ba4ee refs/heads/master')
 
88
        self.assertEqual(
 
89
                {b'refs/heads/master': b'2001b954f1ec392f84f7cec2f2f96a76ed6ba4ee'},
 
90
                self._refs.get_packed_refs())
 
91
 
 
92
 
76
93