mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
test(model-catalog): lock in JSON entry ordering
This commit is contained in:
parent
ca835b7f32
commit
00533d1639
1 changed files with 29 additions and 0 deletions
|
|
@ -117,6 +117,35 @@ fn alias_collisions_and_case_fallback_follow_python_order(
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn json_entry_order_controls_alias_ownership_and_case_fallback() {
|
||||
let forward = Catalog::parse(
|
||||
br#"{
|
||||
"Alpha":{"aliases":["shared"]},
|
||||
"Beta":{"aliases":["shared"]},
|
||||
"Foo":{},
|
||||
"fOO":{}
|
||||
}"#,
|
||||
Provenance::default(),
|
||||
)
|
||||
.unwrap();
|
||||
let reversed = Catalog::parse(
|
||||
br#"{
|
||||
"fOO":{},
|
||||
"Foo":{},
|
||||
"Beta":{"aliases":["shared"]},
|
||||
"Alpha":{"aliases":["shared"]}
|
||||
}"#,
|
||||
Provenance::default(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(forward.lookup("shared").unwrap().canonical_key, "Alpha");
|
||||
assert_eq!(reversed.lookup("shared").unwrap().canonical_key, "Beta");
|
||||
assert_eq!(forward.lookup("foo").unwrap().canonical_key, "fOO");
|
||||
assert_eq!(reversed.lookup("foo").unwrap().canonical_key, "Foo");
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
enum ValidationOutcome {
|
||||
Ok,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue