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

Function frozen_origname_matches

crates/vm/src/vm/mod.rs:2306–2328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2304
2305#[test]
2306fn frozen_origname_matches() {
2307 use rustpython_vm as vm;
2308
2309 vm::Interpreter::builder(Default::default())
2310 .build()
2311 .enter(|vm| {
2312 let check = |name, expected| {
2313 let module = import::import_frozen(vm, name).unwrap();
2314 let origname: PyStrRef = module
2315 .get_attr("__origname__", vm)
2316 .unwrap()
2317 .try_into_value(vm)
2318 .unwrap();
2319 assert_eq!(origname.as_wtf8(), expected);
2320 };
2321
2322 check("_frozen_importlib", "importlib._bootstrap");
2323 check(
2324 "_frozen_importlib_external",
2325 "importlib._bootstrap_external",
2326 );
2327 });
2328}

Callers

nothing calls this directly

Calls 7

import_frozenFunction · 0.85
try_into_valueMethod · 0.80
checkFunction · 0.50
enterMethod · 0.45
buildMethod · 0.45
unwrapMethod · 0.45
get_attrMethod · 0.45

Tested by

no test coverage detected