MCPcopy Create free account
hub / github.com/Autoparallel/learner / test_learner_creation

Function test_learner_creation

crates/learner/src/lib.rs:709–723  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

707
708 #[tokio::test]
709 async fn test_learner_creation() {
710 let config_dir = tempdir().unwrap();
711 let database_dir = tempdir().unwrap();
712 let storage_dir = tempdir().unwrap();
713 let config = Config::default()
714 .with_database_path(&database_dir.path().join("learner.db"))
715 .with_retrievers_path(&config_dir.path().join("config/retrievers/"))
716 .with_storage_path(storage_dir.path());
717 let learner =
718 Learner::builder().with_path(config_dir.path()).with_config(config).build().await.unwrap();
719
720 assert_eq!(learner.config.retrievers_path, config_dir.path().join("config/retrievers/"));
721 assert_eq!(learner.config.database_path, database_dir.path().join("learner.db"));
722 assert_eq!(learner.database.get_storage_path().await.unwrap(), storage_dir.path());
723 }
724}

Callers

nothing calls this directly

Calls 7

with_storage_pathMethod · 0.80
with_retrievers_pathMethod · 0.80
with_database_pathMethod · 0.80
pathMethod · 0.80
buildMethod · 0.80
with_pathMethod · 0.80
with_configMethod · 0.45

Tested by

no test coverage detected