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

Function test_global_config_with_server

atomic-config/src/lib.rs:1685–1714  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1683
1684 #[test]
1685 fn test_global_config_with_server() {
1686 let config = GlobalConfig {
1687 author: Author {
1688 name: "Test User".to_string(),
1689 email: Some("test@example.com".to_string()),
1690 identity: None,
1691 },
1692 server: ServerConfig {
1693 url: Some("https://atomic.storage".to_string()),
1694 default_org: Some("alice".to_string()),
1695 default_workspaces: BTreeMap::new(),
1696 identity: None,
1697 agent_identity: None,
1698 single_tenant: false,
1699 },
1700 ..GlobalConfig::default()
1701 };
1702
1703 let toml_str = toml::to_string_pretty(&config).unwrap();
1704 assert!(toml_str.contains("[server]"));
1705 assert!(toml_str.contains("url = \"https://atomic.storage\""));
1706
1707 let parsed: GlobalConfig = toml::from_str(&toml_str).unwrap();
1708 assert_eq!(
1709 parsed.server.url,
1710 Some("https://atomic.storage".to_string())
1711 );
1712 assert_eq!(parsed.server.default_org, Some("alice".to_string()));
1713 assert!(parsed.server.is_configured());
1714 }
1715
1716 #[test]
1717 fn test_default_workspaces_skipped_when_empty() {

Callers

nothing calls this directly

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected