Ejemplo n.º 1
0
class GitClientTests(TestCase):
    def setUp(self):
        self.rout = StringIO()
        self.rin = StringIO()
        self.client = GitClient(lambda x: True, self.rin.read, self.rout.write)

    def test_caps(self):
        self.assertEquals(
            ['multi_ack', 'side-band-64k', 'ofs-delta', 'thin-pack'],
            self.client._capabilities)

    def test_fetch_pack_none(self):
        self.rin.write(
            "008855dcc6bf963f922e1ed5c4bbaaefcfacef57b1d7 HEAD.multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag\n"
            "0000")
        self.rin.seek(0)
        self.client.fetch_pack("bla", lambda heads: [], None, None, None)
        self.assertEquals(self.rout.getvalue(), "0000")
Ejemplo n.º 2
0
class GitClientTests(TestCase):

    def setUp(self):
        self.rout = StringIO()
        self.rin = StringIO()
        self.client = GitClient(lambda x: True, self.rin.read, 
            self.rout.write)

    def test_caps(self):
        self.assertEquals(['multi_ack', 'side-band-64k', 'ofs-delta', 'thin-pack'], self.client._capabilities)

    def test_fetch_pack_none(self):
        self.rin.write(
            "008855dcc6bf963f922e1ed5c4bbaaefcfacef57b1d7 HEAD.multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag\n"
            "0000")
        self.rin.seek(0)
        self.client.fetch_pack("bla", lambda heads: [], None, None, None)
        self.assertEquals(self.rout.getvalue(), "0000")
Ejemplo n.º 3
0
 def __init__(self, can_read, read, write):
     self.can_read = can_read
     self.read = read
     self.write = write
     GitClient.__init__(self)
Ejemplo n.º 4
0
 def setUp(self):
     self.rout = StringIO()
     self.rin = StringIO()
     self.client = GitClient(lambda x: True, self.rin.read, self.rout.write)
Ejemplo n.º 5
0
 def setUp(self):
     self.rout = StringIO()
     self.rin = StringIO()
     self.client = GitClient(lambda x: True, self.rin.read, 
         self.rout.write)