Пример #1
0
 def test_repo_clone_without_update(self):
     repo = MercurialRepository(TEST_HG_REPO)
     repo_clone = MercurialRepository(TEST_HG_REPO_CLONE + '_wo_update',
         src_url=TEST_HG_REPO, update_after_clone=False)
     self.assertEqual(len(repo.revisions), len(repo_clone.revisions))
     self.assertEqual(os.path.isfile(os.path.join(TEST_HG_REPO_CLONE \
                                                 + '_wo_update',
                                                 'MANIFEST.in')), False,)
Пример #2
0
    def test_repo_clone_with_update(self):
        repo = MercurialRepository(TEST_HG_REPO)
        repo_clone = MercurialRepository(TEST_HG_REPO_CLONE + '_w_update',
            src_url=TEST_HG_REPO, update_after_clone=True)
        self.assertEqual(len(repo.revisions), len(repo_clone.revisions))

        #check if current workdir was updated
        self.assertEqual(os.path.isfile(os.path.join(TEST_HG_REPO_CLONE \
                                                    + '_w_update',
                                                    'MANIFEST.in')), True,)
Пример #3
0
 def test_repo_clone(self):
     self.__check_for_existing_repo()
     repo = MercurialRepository(TEST_HG_REPO)
     repo_clone = MercurialRepository(TEST_HG_REPO_CLONE,
         src_url=TEST_HG_REPO, update_after_clone=True)
     self.assertEqual(len(repo.revisions), len(repo_clone.revisions))
     # Checking hashes of changesets should be enough
     for changeset in repo.get_changesets():
         raw_id = changeset.raw_id
         self.assertEqual(raw_id, repo_clone.get_changeset(raw_id).raw_id)
Пример #4
0
    def test_pull(self):
        if os.path.exists(TEST_HG_REPO_PULL):
            self.fail('Cannot test mercurial pull command as location %s '
                      'already exists. You should manually remove it first'
                      % TEST_HG_REPO_PULL)
        repo_new = MercurialRepository(TEST_HG_REPO_PULL, create=True)
        self.assertTrue(len(self.repo.revisions) > len(repo_new.revisions))

        repo_new.pull(self.repo.path)
        repo_new = MercurialRepository(TEST_HG_REPO_PULL)
        self.assertTrue(len(self.repo.revisions) == len(repo_new.revisions))
Пример #5
0
 def test_unicode_path_repo(self):
     self.assertRaises(VCSError,lambda:MercurialRepository(u'iShouldFail'))
Пример #6
0
 def setUp(self):
     self.repo = MercurialRepository(TEST_HG_REPO)