MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_name_resolution

Method test_name_resolution

Lib/test/test_pkgutil.py:235–324  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

233
234 @unittest.expectedFailure # TODO: RUSTPYTHON
235 def test_name_resolution(self):
236 import logging
237 import logging.handlers
238
239 success_cases = (
240 ('os', os),
241 ('os.path', os.path),
242 ('os.path:pathsep', os.path.pathsep),
243 ('logging', logging),
244 ('logging:', logging),
245 ('logging.handlers', logging.handlers),
246 ('logging.handlers:', logging.handlers),
247 ('logging.handlers:SysLogHandler', logging.handlers.SysLogHandler),
248 ('logging.handlers.SysLogHandler', logging.handlers.SysLogHandler),
249 ('logging.handlers:SysLogHandler.LOG_ALERT',
250 logging.handlers.SysLogHandler.LOG_ALERT),
251 ('logging.handlers.SysLogHandler.LOG_ALERT',
252 logging.handlers.SysLogHandler.LOG_ALERT),
253 ('builtins.int', int),
254 ('builtins:int', int),
255 ('builtins.int.from_bytes', int.from_bytes),
256 ('builtins:int.from_bytes', int.from_bytes),
257 ('builtins.ZeroDivisionError', ZeroDivisionError),
258 ('builtins:ZeroDivisionError', ZeroDivisionError),
259 ('os:path', os.path),
260 )
261
262 failure_cases = (
263 (None, TypeError),
264 (1, TypeError),
265 (2.0, TypeError),
266 (True, TypeError),
267 ('', ValueError),
268 ('?abc', ValueError),
269 ('abc/foo', ValueError),
270 ('foo', ImportError),
271 ('os.foo', AttributeError),
272 ('os.foo:', ImportError),
273 ('os.pth:pathsep', ImportError),
274 ('logging.handlers:NoSuchHandler', AttributeError),
275 ('logging.handlers:SysLogHandler.NO_SUCH_VALUE', AttributeError),
276 ('logging.handlers.SysLogHandler.NO_SUCH_VALUE', AttributeError),
277 ('ZeroDivisionError', ImportError),
278 ('os.path.9abc', ValueError),
279 ('9abc', ValueError),
280 )
281
282 # add some Unicode package names to the mix.
283
284 unicode_words = ('\u0935\u092e\u0938',
285 '\xe9', '\xc8',
286 '\uc548\ub155\ud558\uc138\uc694',
287 '\u3055\u3088\u306a\u3089',
288 '\u3042\u308a\u304c\u3068\u3046',
289 '\u0425\u043e\u0440\u043e\u0448\u043e',
290 '\u0441\u043f\u0430\u0441\u0438\u0431\u043e',
291 '\u73b0\u4ee3\u6c49\u8bed\u5e38\u7528\u5b57\u8868')
292

Callers

nothing calls this directly

Calls 10

lenFunction · 0.85
subTestMethod · 0.80
openFunction · 0.50
joinMethod · 0.45
writeMethod · 0.45
flushMethod · 0.45
invalidate_cachesMethod · 0.45
import_moduleMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected