예제 #1
0
 def test_init_command(self):
     """Initialize the conduit in the working directory.
     """
     with Tempdir(cwd=True) as tempdir:
         repository = join(dirname(__file__), 'data', 'greek')
         self.assertEquals(0, init().eval('--quiet', repository))
         self.assertEquals(repository, Git().config_get('cvs.source'))
예제 #2
0
    def test_clone_partial_alternative(self):
        """Calling "pull --limit=<limit>" several times is basically
        the same as cloning everything (given that it's done enough
        times or that <limit> is high enough.)
        """
        head1 = None
        with Tempdir(cwd=True) as tempdir:
            source = join(dirname(__file__), 'data', 'zombie')
            self.assertEquals(0, Clone().eval('--quiet', source))
            os.chdir('zombie')
            head1 = Git().rev_parse('HEAD')

        head2 = None
        with Tempdir(cwd=True) as tempdir:
            source = join(dirname(__file__), 'data', 'zombie')
            self.assertEquals(0, init().eval('--quiet', source))
            self.assertEquals(0, pull().eval('--quiet', '--limit=1'))
            self.assertNotEqual(head1, Git().rev_parse('HEAD'))
            self.assertEquals(0, pull().eval('--quiet', '--limit=2'))
            self.assertNotEqual(head1, Git().rev_parse('HEAD'))
            self.assertEquals(0, pull().eval('--quiet', '--limit=3'))
            self.assertEqual(head1, Git().rev_parse('HEAD'))