summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/tests/test_pypi_simple.py
diff options
context:
space:
mode:
authorTarek Ziade <tarek@ziade.org>2011-05-21 20:47:40 (GMT)
committerTarek Ziade <tarek@ziade.org>2011-05-21 20:47:40 (GMT)
commitcc243cc8085ffd7b184d52e9250b64d8ee3eb1a0 (patch)
tree70c4c24bbabc8e20ef22b86be989379faedd14f6 /Lib/packaging/tests/test_pypi_simple.py
parent76ad4f0ec9be19ccd341bb0989d8de08671d29f5 (diff)
downloadcpython-cc243cc8085ffd7b184d52e9250b64d8ee3eb1a0.zip
cpython-cc243cc8085ffd7b184d52e9250b64d8ee3eb1a0.tar.gz
cpython-cc243cc8085ffd7b184d52e9250b64d8ee3eb1a0.tar.bz2
make sure the crawler can browse file-based indexes under win32
Diffstat (limited to 'Lib/packaging/tests/test_pypi_simple.py')
-rw-r--r--Lib/packaging/tests/test_pypi_simple.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/Lib/packaging/tests/test_pypi_simple.py b/Lib/packaging/tests/test_pypi_simple.py
index 6f0d8d9..d50e3f4 100644
--- a/Lib/packaging/tests/test_pypi_simple.py
+++ b/Lib/packaging/tests/test_pypi_simple.py
@@ -1,5 +1,5 @@
"""Tests for the packaging.pypi.simple module."""
-
+import re
import os
import sys
import http.client
@@ -277,8 +277,16 @@ class SimpleCrawlerTestCase(TempdirManager,
def test_browse_local_files(self):
# Test that we can browse local files"""
- index_path = os.sep.join(["file://" + PYPI_DEFAULT_STATIC_PATH,
- "test_found_links", "simple"])
+ index_url = "file://" + PYPI_DEFAULT_STATIC_PATH
+ if sys.platform == 'win32':
+ # under windows the correct syntax is:
+ # file:///C|\the\path\here
+ # instead of
+ # file://C:\the\path\here
+ fix = re.compile(r'^(file://)([A-Za-z])(:)')
+ index_url = fix.sub('\\1/\\2|', index_url)
+
+ index_path = os.sep.join([index_url, "test_found_links", "simple"])
crawler = Crawler(index_path)
dists = crawler.get_releases("foobar")
self.assertEqual(4, len(dists))