diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2007-12-03 12:55:17 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2007-12-03 12:55:17 (GMT) |
commit | ef01d822aaea11ae25f78cb0be32865a5df07620 (patch) | |
tree | 0fbbaa653cb033490019809a9eb8b3c3ac942c74 /Lib/test/test_pkg.py | |
parent | f19b95112669db32556c157c04f064d319c11f09 (diff) | |
download | cpython-ef01d822aaea11ae25f78cb0be32865a5df07620.zip cpython-ef01d822aaea11ae25f78cb0be32865a5df07620.tar.gz cpython-ef01d822aaea11ae25f78cb0be32865a5df07620.tar.bz2 |
Implement PEP 366
Diffstat (limited to 'Lib/test/test_pkg.py')
-rw-r--r-- | Lib/test/test_pkg.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py index 7a4c01b..28f9943 100644 --- a/Lib/test/test_pkg.py +++ b/Lib/test/test_pkg.py @@ -188,11 +188,13 @@ class Test(unittest.TestCase): import t5 self.assertEqual(fixdir(dir(t5)), ['__doc__', '__file__', '__name__', - '__path__', 'foo', 'string', 't5']) + '__package__', '__path__', 'foo', 'string', 't5']) self.assertEqual(fixdir(dir(t5.foo)), - ['__doc__', '__file__', '__name__', 'string']) + ['__doc__', '__file__', '__name__', '__package__', + 'string']) self.assertEqual(fixdir(dir(t5.string)), - ['__doc__', '__file__', '__name__', 'spam']) + ['__doc__', '__file__', '__name__','__package__', + 'spam']) def test_6(self): hier = [ @@ -208,14 +210,14 @@ class Test(unittest.TestCase): import t6 self.assertEqual(fixdir(dir(t6)), ['__all__', '__doc__', '__file__', - '__name__', '__path__']) + '__name__', '__package__', '__path__']) s = """ import t6 from t6 import * self.assertEqual(fixdir(dir(t6)), ['__all__', '__doc__', '__file__', - '__name__', '__path__', 'eggs', - 'ham', 'spam']) + '__name__', '__package__', '__path__', + 'eggs', 'ham', 'spam']) self.assertEqual(dir(), ['eggs', 'ham', 'self', 'spam', 't6']) """ self.run_code(s) @@ -241,17 +243,19 @@ class Test(unittest.TestCase): t7, sub, subsub = None, None, None import t7 as tas self.assertEqual(fixdir(dir(tas)), - ['__doc__', '__file__', '__name__', '__path__']) + ['__doc__', '__file__', '__name__', + '__package__', '__path__']) self.failIf(t7) from t7 import sub as subpar self.assertEqual(fixdir(dir(subpar)), - ['__doc__', '__file__', '__name__', '__path__']) + ['__doc__', '__file__', '__name__', + '__package__', '__path__']) self.failIf(t7) self.failIf(sub) from t7.sub import subsub as subsubsub self.assertEqual(fixdir(dir(subsubsub)), - ['__doc__', '__file__', '__name__', '__path__', - 'spam']) + ['__doc__', '__file__', '__name__', + '__package__', '__path__', 'spam']) self.failIf(t7) self.failIf(sub) self.failIf(subsub) |