Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # Test packages (dotted-name import) | 1 # Test packages (dotted-name import) |
2 | 2 |
3 import sys | 3 import sys |
4 import os | 4 import os |
5 import tempfile | 5 import tempfile |
6 import textwrap | 6 import textwrap |
7 import unittest | 7 import unittest |
8 from test import support | 8 from test import support |
9 | 9 |
10 | 10 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 | 189 |
190 import t5 | 190 import t5 |
191 s = """ | 191 s = """ |
192 from t5 import * | 192 from t5 import * |
193 self.assertEqual(dir(), ['foo', 'self', 'string', 't5']) | 193 self.assertEqual(dir(), ['foo', 'self', 'string', 't5']) |
194 """ | 194 """ |
195 self.run_code(s) | 195 self.run_code(s) |
196 | 196 |
197 import t5 | 197 import t5 |
198 self.assertEqual(fixdir(dir(t5)), | 198 self.assertEqual(fixdir(dir(t5)), |
199 ['__cached__', '__doc__', '__file__', '__name__', | 199 ['__cached__', '__doc__', '__file__', '__name__', |
Antoine Pitrou
2010/04/09 23:39:32
Do we want to check the value of the __cached__ at
barry
2010/04/12 21:59:05
Here? No I don't think we need to. test_import.p
| |
200 '__package__', '__path__', 'foo', 'string', 't5']) | 200 '__package__', '__path__', 'foo', 'string', 't5']) |
201 self.assertEqual(fixdir(dir(t5.foo)), | 201 self.assertEqual(fixdir(dir(t5.foo)), |
202 ['__cached__', '__doc__', '__file__', '__name__', | 202 ['__cached__', '__doc__', '__file__', '__name__', |
203 '__package__', 'string']) | 203 '__package__', 'string']) |
204 self.assertEqual(fixdir(dir(t5.string)), | 204 self.assertEqual(fixdir(dir(t5.string)), |
205 ['__cached__', '__doc__', '__file__', '__name__', | 205 ['__cached__', '__doc__', '__file__', '__name__', |
206 '__package__', 'spam']) | 206 '__package__', 'spam']) |
207 | 207 |
208 def test_6(self): | 208 def test_6(self): |
209 hier = [ | 209 hier = [ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 | 285 |
286 import t8 | 286 import t8 |
287 self.assertEqual(t8.__doc__, "doc for t8") | 287 self.assertEqual(t8.__doc__, "doc for t8") |
288 | 288 |
289 def test_main(): | 289 def test_main(): |
290 support.run_unittest(__name__) | 290 support.run_unittest(__name__) |
291 | 291 |
292 | 292 |
293 if __name__ == "__main__": | 293 if __name__ == "__main__": |
294 test_main() | 294 test_main() |
LEFT | RIGHT |