Fix test_urllib2 error on Windows in relation with issue #13287.
authorFlorent Xicluna <florent.xicluna@gmail.com>
Fri, 4 Nov 2011 21:15:37 +0000 (22:15 +0100)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Fri, 4 Nov 2011 21:15:37 +0000 (22:15 +0100)
Lib/test/test_urllib2.py

index e55140e1d83142cd3dba0e09a32d2e2274471d73..aa1854d5ce3c64789742c99cd66d3993448e424f 100644 (file)
@@ -26,6 +26,10 @@ class TrivialTests(unittest.TestCase):
             context = {}
             exec('from urllib.%s import *' % module, context)
             del context['__builtins__']
+            if module == 'request' and os.name == 'nt':
+                u, p = context.pop('url2pathname'), context.pop('pathname2url')
+                self.assertEqual(u.__module__, 'nturl2path')
+                self.assertEqual(p.__module__, 'nturl2path')
             for k, v in context.items():
                 self.assertEqual(v.__module__, 'urllib.%s' % module,
                     "%r is exposed in 'urllib.%s' but defined in %r" %