aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-02-12 21:30:46 -0500
committerGitHub <noreply@github.com>2017-02-12 21:30:46 -0500
commit8ed00a708e1b258bf6647db2ba95de357d3ae9a2 (patch)
tree0cd781091bba984d0e1d5ea1de1e10d8da17a029 /setuptools/tests
parent5470fb8fdf3a65cd18541980bf38e4984b5b1775 (diff)
parentf33cfac393676065088bf7b704207bdcda0fdd4f (diff)
downloadexternal_python_setuptools-8ed00a708e1b258bf6647db2ba95de357d3ae9a2.tar.gz
external_python_setuptools-8ed00a708e1b258bf6647db2ba95de357d3ae9a2.tar.bz2
external_python_setuptools-8ed00a708e1b258bf6647db2ba95de357d3ae9a2.zip
Merge pull request #968 from moriyoshi/moriyoshi/local-version-label-in-egg-fragment
A local version label starts with a '+' sign
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_packageindex.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index d68867c2..1a66394f 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -181,6 +181,48 @@ class TestPackageIndex:
res = setuptools.package_index.local_open(url)
assert 'content' in res.read()
+ def test_egg_fragment(self):
+ """
+ EGG fragments must comply to PEP 440
+ """
+ epoch = [
+ '',
+ '1!',
+ ]
+ releases = [
+ '0',
+ '0.0',
+ '0.0.0',
+ ]
+ pre = [
+ 'a0',
+ 'b0',
+ 'rc0',
+ ]
+ post = [
+ '.post0'
+ ]
+ dev = [
+ '.dev0',
+ ]
+ local = [
+ ('', ''),
+ ('+ubuntu.0', '+ubuntu.0'),
+ ('+ubuntu-0', '+ubuntu.0'),
+ ('+ubuntu_0', '+ubuntu.0'),
+ ]
+ versions = [
+ [''.join([e, r, p, l]) for l in ll]
+ for e in epoch
+ for r in releases
+ for p in sum([pre, post, dev], [''])
+ for ll in local]
+ for v, vc in versions:
+ dists = list(setuptools.package_index.distros_for_url(
+ 'http://example.com/example.zip#egg=example-' + v))
+ assert dists[0].version == ''
+ assert dists[1].version == vc
+
class TestContentCheckers:
def test_md5(self):