示例#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")
示例#2
0
 def setUp(self):
     self.rout = StringIO()
     self.rin = StringIO()
     self.client = GitClient(lambda x: True, self.rin.read, self.rout.write)