aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_sdist.py
diff options
context:
space:
mode:
authorPhilip Thiem <ptthiem@gmail.com>2013-07-20 17:45:04 -0500
committerPhilip Thiem <ptthiem@gmail.com>2013-07-20 17:45:04 -0500
commitb4ba33898f4d67af70319a0bb64edca72fc3ecee (patch)
tree6570fef0f808141aed5b93275f8b86469224eee4 /setuptools/tests/test_sdist.py
parent411379b73db3bc4955e369affc448cd10ac025e6 (diff)
downloadexternal_python_setuptools-b4ba33898f4d67af70319a0bb64edca72fc3ecee.tar.gz
external_python_setuptools-b4ba33898f4d67af70319a0bb64edca72fc3ecee.tar.bz2
external_python_setuptools-b4ba33898f4d67af70319a0bb64edca72fc3ecee.zip
Additional Tests, Various fixes, and encoding dealings
--HG-- extra : rebase_source : 2734e79e08e194923eab8c70f92cb77bce7daccf
Diffstat (limited to 'setuptools/tests/test_sdist.py')
-rw-r--r--setuptools/tests/test_sdist.py64
1 files changed, 62 insertions, 2 deletions
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py
index 438f7ced..8d6aff19 100644
--- a/setuptools/tests/test_sdist.py
+++ b/setuptools/tests/test_sdist.py
@@ -8,12 +8,14 @@ import sys
import tempfile
import unittest
import unicodedata
+from setuptools.tests import environment
from setuptools.compat import StringIO, unicode
-from setuptools.command.sdist import sdist
+from setuptools.command.sdist import sdist, walk_revctrl
from setuptools.command.egg_info import manifest_maker
from setuptools.dist import Distribution
-
+from setuptools import svn_utils
+from setuptools.svn_utils import fsencode
SETUP_ATTRS = {
'name': 'sdist_test',
@@ -395,6 +397,64 @@ class TestSdistTest(unittest.TestCase):
self.assertTrue(filename in cmd.filelist.files)
+class TestSvn(environment.ZippedEnvironment):
+
+ def setUp(self):
+ version = svn_utils.SvnInfo.get_svn_version()
+ self.base_version = tuple([int(x) for x in version.split('.')][:2])
+
+ if not self.base_version:
+ raise ValueError('No SVN tools installed')
+ elif self.base_version < (1,3):
+ raise ValueError('Insufficient SVN Version %s' % version)
+ elif self.base_version >= (1,9):
+ #trying the latest version
+ self.base_version = (1,8)
+
+ self.dataname = "svn%i%i_example" % self.base_version
+ self.datafile = os.path.join('setuptools', 'tests',
+ 'svn_data', self.dataname + ".zip")
+ super(TestSvn, self).setUp()
+
+ def test_walksvn(self):
+ if self.base_version >= (1,6):
+ folder2 = 'third party2'
+ folder3 = 'third party3'
+ else:
+ folder2 = 'third_party2'
+ folder3 = 'third_party3'
+
+ #TODO is this right
+ expected = set([
+ os.path.join('a file'),
+ os.path.join(folder2, 'Changes.txt'),
+ os.path.join(folder2, 'MD5SUMS'),
+ os.path.join(folder2, 'README.txt'),
+ os.path.join(folder3, 'Changes.txt'),
+ os.path.join(folder3, 'MD5SUMS'),
+ os.path.join(folder3, 'README.txt'),
+ os.path.join(folder3, 'TODO.txt'),
+ os.path.join(folder3, 'fin'),
+ os.path.join('third_party', 'README.txt'),
+ os.path.join('folder', folder2, 'Changes.txt'),
+ os.path.join('folder', folder2, 'MD5SUMS'),
+ os.path.join('folder', folder2, 'WatashiNiYomimasu.txt'),
+ os.path.join( 'folder', folder3, 'Changes.txt'),
+ os.path.join('folder', folder3, 'fin'),
+ os.path.join('folder', folder3, 'MD5SUMS'),
+ os.path.join('folder', folder3, 'oops'),
+ os.path.join('folder', folder3, 'WatashiNiYomimasu.txt'),
+ os.path.join('folder', folder3, 'ZuMachen.txt'),
+ os.path.join('folder', 'third_party', 'WatashiNiYomimasu.txt'),
+ os.path.join('folder', 'lalala.txt'),
+ os.path.join('folder', 'quest.txt'),
+ #The example will have a deleted file (or should) but shouldn't return it
+ ])
+ expected = set(fsencode(x) for x in expected)
+ self.assertEqual(set(x for x in walk_revctrl()), expected)
+
+
+
def test_suite():
return unittest.defaultTestLoader.loadTestsFromName(__name__)