Add a snapshot test for native module resolution (#5423)

This commit is contained in:
Charlie Marsh 2023-06-28 14:16:39 -04:00 committed by GitHub
parent 864f50a3a4
commit 0e12eb3071
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 190 additions and 24 deletions

View file

@ -896,4 +896,46 @@ mod tests {
assert_debug_snapshot!(result);
}
#[test]
fn airflow_explicit_native_module() {
setup();
let root = PathBuf::from("./resources/test/airflow");
let source_file = root.join("airflow/api/common/mark_tasks.py");
let result = resolve_options(
source_file,
"_watchdog_fsevents",
root.clone(),
ResolverOptions {
venv_path: Some(root),
venv: Some(PathBuf::from("venv")),
..Default::default()
},
);
assert_debug_snapshot!(result);
}
#[test]
fn airflow_implicit_native_module() {
setup();
let root = PathBuf::from("./resources/test/airflow");
let source_file = root.join("airflow/api/common/mark_tasks.py");
let result = resolve_options(
source_file,
"orjson",
root.clone(),
ResolverOptions {
venv_path: Some(root),
venv: Some(PathBuf::from("venv")),
..Default::default()
},
);
assert_debug_snapshot!(result);
}
}