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

Function test_model_usage_builder

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

Source from the content-addressed store, hash-verified

833
834 #[test]
835 fn test_model_usage_builder() {
836 let m = ModelUsage::new("claude-sonnet-4-5")
837 .with_input(176)
838 .with_output(8400)
839 .with_cache_read(526_900)
840 .with_cache_write(13_100)
841 .with_cost(0.56);
842
843 assert_eq!(m.input_tokens, 176);
844 assert_eq!(m.output_tokens, 8400);
845 assert_eq!(m.cache_read_tokens, 526_900);
846 assert_eq!(m.cache_write_tokens, 13_100);
847 assert_eq!(m.cost_usd, 0.56);
848 assert_eq!(m.total_tokens(), 176 + 8400 + 526_900 + 13_100);
849 }
850
851 #[test]
852 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