From 1d1a40016402da2a28019b4683b1afa4b2a51e8c Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 1 Nov 2007 19:41:07 +0000 Subject: Added unit test for bug http://bugs.python.org/issue1293 --- Lib/test/test_import.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 7bb122d..bb56072 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -1,4 +1,4 @@ -from test.test_support import TESTFN, run_unittest, catch_warning +from test.test_support import TESTFN, run_unittest, catch_warning import unittest import os @@ -187,6 +187,16 @@ class UnicodePathsTests(unittest.TestCase): self.assertEqual(mod.testdata, 'unicode path %i' % i) unload("testimport%i" % i) + # http://bugs.python.org/issue1293 + def test_trailing_slash(self): + f = open(os.path.join(self.path, 'test_trailing_slash.py'), 'w') + f.write("testdata = 'test_trailing_slash'") + f.close() + sys.path.append(self.path+'/') + mod = __import__("test_trailing_slash") + self.assertEqual(mod.testdata, 'test_trailing_slash') + unload("test_trailing_slash") + def test_main(verbose=None): run_unittest(ImportTest, UnicodePathsTests) -- cgit v0.12