()
| 70 | |
| 71 | #[test] |
| 72 | fn bare_name_with_env_override() { |
| 73 | let _guard = env_lock().lock().unwrap(); |
| 74 | // Use a temp env override. Safety: test-only, and these env-var tests |
| 75 | // are not run concurrently with other tests reading the same var. |
| 76 | let key = "OPENSHELL_COMMUNITY_REGISTRY"; |
| 77 | let prev = std::env::var(key).ok(); |
| 78 | // SAFETY: single-threaded test context; no other thread reads this var. |
| 79 | unsafe { std::env::set_var(key, "my-registry.example.com/sandboxes") }; |
| 80 | let result = resolve_community_image("python"); |
| 81 | assert_eq!(result, "my-registry.example.com/sandboxes/python:latest"); |
| 82 | // Restore. |
| 83 | match prev { |
| 84 | Some(v) => unsafe { std::env::set_var(key, v) }, |
| 85 | None => unsafe { std::env::remove_var(key) }, |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | #[test] |
| 90 | fn full_reference_with_slash_passes_through() { |
nothing calls this directly
no test coverage detected