From c147c6789efe24bf54e20d5644aa338bd532adb7 Mon Sep 17 00:00:00 2001 From: Philip Thiem Date: Wed, 23 Apr 2014 18:29:43 -0500 Subject: Add Regression Tests for svn tagging. --HG-- branch : develop extra : rebase_source : a05d5f844416113562066786c697170ed85c48fd --- setuptools/tests/test_egg_info.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'setuptools/tests') diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 27854366..4c41a2cc 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -138,6 +138,43 @@ class TestSvnDummy(environment.ZippedEnvironment): return data + @skipIf(not test_svn._svn_check, "No SVN to text, in the first place") + def test_svn_tags(self): + code, data = environment.run_setup_py(["egg_info", + "--tag-svn-revision"], + pypath=self.old_cwd, + data_stream=1) + if code: + raise AssertionError(data) + + pkginfo = os.path.join('dummy.egg-info', 'PKG-INFO') + infile = open(pkginfo, 'r') + try: + read_contents = infile.readlines() + finally: + infile.close() + del infile + + self.assertIn("Version: 0.1.1-r1\n", read_contents) + + @skipIf(not test_svn._svn_check, "No SVN to text, in the first place") + def test_no_tags(self): + code, data = environment.run_setup_py(["egg_info"], + pypath=self.old_cwd, + data_stream=1) + if code: + raise AssertionError(data) + + pkginfo = os.path.join('dummy.egg-info', 'PKG-INFO') + infile = open(pkginfo, 'r') + try: + read_contents = infile.readlines() + finally: + infile.close() + del infile + + self.assertIn("Version: 0.1.1\n", read_contents) + class TestSvnDummyLegacy(environment.ZippedEnvironment): -- cgit v1.2.1 From c1d08d7441c9fc059241232eb7323d2a90d12b6e Mon Sep 17 00:00:00 2001 From: Philip Thiem Date: Sat, 17 May 2014 16:12:20 -0500 Subject: PY26 doesn't have assertIn --HG-- branch : develop extra : rebase_source : a891af85b68115431db3fe42acf5a102e02aa8b9 --- setuptools/tests/test_egg_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setuptools/tests') diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 4c41a2cc..7531e37c 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -155,7 +155,7 @@ class TestSvnDummy(environment.ZippedEnvironment): infile.close() del infile - self.assertIn("Version: 0.1.1-r1\n", read_contents) + self.assertTrue("Version: 0.1.1-r1\n" in read_contents) @skipIf(not test_svn._svn_check, "No SVN to text, in the first place") def test_no_tags(self): @@ -173,7 +173,7 @@ class TestSvnDummy(environment.ZippedEnvironment): infile.close() del infile - self.assertIn("Version: 0.1.1\n", read_contents) + self.assertTrue("Version: 0.1.1\n" in read_contents) class TestSvnDummyLegacy(environment.ZippedEnvironment): -- cgit v1.2.1