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

Function test_storage_path_valid

crates/learner/src/database/tests.rs:96–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94#[traced_test]
95#[tokio::test]
96async fn test_storage_path_valid() -> Result<()> {
97 let (db, _path, dir) = setup_test_db().await;
98
99 // Create an absolute path without requiring existence
100 let test_path = dir.path().join("storage");
101
102 // Set the storage path (this will create the directory)
103 db.set_storage_path(&test_path).await?;
104
105 // Get and verify the stored path
106 let stored_path = db.get_storage_path().await?;
107 assert_eq!(stored_path, test_path);
108 assert!(test_path.exists());
109
110 // Verify we can write to the directory
111 let test_file = test_path.join("test.txt");
112 std::fs::write(&test_file, b"test")?;
113 assert!(test_file.exists());
114
115 Ok(())
116}
117
118#[traced_test]
119#[tokio::test]

Callers

nothing calls this directly

Calls 4

setup_test_dbFunction · 0.85
pathMethod · 0.80
set_storage_pathMethod · 0.80
get_storage_pathMethod · 0.80

Tested by

no test coverage detected