MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_model_usage_builder

Function test_model_usage_builder

atomic-core/src/change/attestation.rs:1356–1370  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1354
1355 #[test]
1356 fn test_model_usage_builder() {
1357 let m = ModelUsage::new("claude-sonnet-4-5")
1358 .with_input(176)
1359 .with_output(8400)
1360 .with_cache_read(526_900)
1361 .with_cache_write(13_100)
1362 .with_cost(0.56);
1363
1364 assert_eq!(m.input_tokens, 176);
1365 assert_eq!(m.output_tokens, 8400);
1366 assert_eq!(m.cache_read_tokens, 526_900);
1367 assert_eq!(m.cache_write_tokens, 13_100);
1368 assert_eq!(m.cost_usd, 0.56);
1369 assert_eq!(m.total_tokens(), 176 + 8400 + 526_900 + 13_100);
1370 }
1371
1372 #[test]
1373 fn test_model_usage_display() {

Callers

nothing calls this directly

Calls 5

with_costMethod · 0.80
with_cache_writeMethod · 0.80
with_cache_readMethod · 0.80
with_outputMethod · 0.80
with_inputMethod · 0.80

Tested by

no test coverage detected