def setUp(self): self.repository_path = os.path.join(example_repositories, "subversion") self.repos = SubversionRepository("file://%s" % self.repository_path) self.tmpdir = tempfile.mkdtemp() self.repos.checkout(self.tmpdir) self.wc = SubversionWorkingCopy(self.tmpdir) self.latest_version = "3" self.previous_version = "1"
class TestSubversionWorkingCopy(unittest.TestCase, BaseTestWorkingCopy): def setUp(self): self.repository_path = os.path.join(example_repositories, "subversion") self.repos = SubversionRepository("file://%s" % self.repository_path) self.tmpdir = tempfile.mkdtemp() self.repos.checkout(self.tmpdir) self.wc = SubversionWorkingCopy(self.tmpdir) self.latest_version = "3" self.previous_version = "1" def tearDown(self): shutil.rmtree(self.tmpdir) #def test__status(self): # self.assertEqual(self.wc.status()['modified'], []) # self.change_file() # self.assertEqual(os.path.basename(self.wc.status()['modified'][0]), 'romans.param') def test__status(self): self.assertEqual( self.wc.status(), { 'modified': set([]), 'removed': set([]), 'missing': set([]), 'unknown': set([]), 'added': set([]), 'clean': set([ 'EGG-INFO', 'subpackage', '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', 'subpackage', 'EGG-INFO/PKG-INFO', 'default.param', 'main.py', 'subpackage/__init__.py', 'subpackage/somemodule.py' ]) })
class TestSubversionWorkingCopy(unittest.TestCase, BaseTestWorkingCopy): def setUp(self): self.repository_path = os.path.join(example_repositories, "subversion") self.repos = SubversionRepository("file://%s" % self.repository_path) self.tmpdir = tempfile.mkdtemp() self.repos.checkout(self.tmpdir) self.wc = SubversionWorkingCopy(self.tmpdir) self.latest_version = "3" self.previous_version = "1" def tearDown(self): shutil.rmtree(self.tmpdir) #def test__status(self): # self.assertEqual(self.wc.status()['modified'], []) # self.change_file() # self.assertEqual(os.path.basename(self.wc.status()['modified'][0]), 'romans.param') def test__status(self): self.assertEqual(self.wc.status(), {'modified': set([]), 'removed': set([]), 'missing': set([]), 'unknown': set([]), 'added': set([]), 'clean': set(['EGG-INFO', 'subpackage', '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', 'subpackage', 'EGG-INFO/PKG-INFO', 'default.param', 'main.py', 'subpackage/__init__.py', 'subpackage/somemodule.py'])})