aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <mozo@mozo.jp>2017-02-13 04:35:30 +0900
committerMoriyoshi Koizumi <mozo@mozo.jp>2017-02-13 04:45:01 +0900
commit57fa89ac2d7461995b7191aeab8a027a86d73120 (patch)
tree49622c3aa9e9fce75a5456851d24de56f616991f /setuptools/tests
parentf1ca29cc9332a1bb59e250aa280ddc5239b5457e (diff)
downloadexternal_python_setuptools-57fa89ac2d7461995b7191aeab8a027a86d73120.tar.gz
external_python_setuptools-57fa89ac2d7461995b7191aeab8a027a86d73120.tar.bz2
external_python_setuptools-57fa89ac2d7461995b7191aeab8a027a86d73120.zip
Add a test.
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):