class TestMercurialWorkingCopy(unittest.TestCase, BaseTestWorkingCopy): def setUp(self): self.repository_path = os.path.abspath("../example_repositories/mercurial") os.symlink("%s/hg" % self.repository_path, "%s/.hg" % self.repository_path) self.repos = MercurialRepository("file://%s" % self.repository_path) self.tmpdir = tempfile.mkdtemp() self.repos.checkout(self.tmpdir) self.wc = MercurialWorkingCopy(self.tmpdir) self.latest_version = "7ba7d226aefe" self.previous_version = "2f63951b5f32" def tearDown(self): os.unlink("%s/.hg" % self.repository_path) shutil.rmtree(self.tmpdir) def test__status(self): self.assertEqual(self.wc.status(), {'modified': set([]), 'removed': set([]), 'missing': set([]), 'unknown': set([]), 'added': set([]), 'clean': set(['EGG-INFO/PKG-INFO', 'default.param', 'main.py', 'romans.param', 'subpackage/__init__.py', 'subpackage/somemodule.py'])}) self.change_file() self.assertEqual(self.wc.status(), {'modified': set(['romans.param']), 'removed': set([]), 'missing': set([]), 'unknown': set([]), 'added': set([]), 'clean': set(['EGG-INFO/PKG-INFO', 'default.param', 'main.py', 'subpackage/__init__.py', 'subpackage/somemodule.py'])})
def setUp(self): self.repository_path = os.path.join(example_repositories, "mercurial") os.symlink("%s/hg" % self.repository_path, "%s/.hg" % self.repository_path) self.repos = MercurialRepository("file://%s" % self.repository_path) self.tmpdir = tempfile.mkdtemp() self.repos.checkout(self.tmpdir) self.wc = MercurialWorkingCopy(self.tmpdir) self.latest_version = "7ba7d226aefe" self.previous_version = "2f63951b5f32"