Skip to content

Commit d217e84

Browse files
committed
fix: tests
1 parent 94e58ee commit d217e84

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

agent-control/src/agent_type/runtime_config/on_host/filesystem.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ impl<'de> Deserialize<'de> for FileEntry {
6868

6969
#[derive(Deserialize)]
7070
struct PreValidationFileEntry {
71-
path: PathBuf,
71+
relative_path: PathBuf,
7272
content: TemplateableValue<String>,
7373
}
7474

7575
let entry = PreValidationFileEntry::deserialize(deserializer)?;
7676
// Perform validations on the provided Paths
77-
if let Err(errs) = validate_file_entry_path(&entry.path) {
77+
if let Err(errs) = validate_file_entry_path(&entry.relative_path) {
7878
Err(Error::custom(errs.join(", ")))
7979
} else {
8080
Ok(Self {
81-
relative_path: entry.path,
81+
relative_path: entry.relative_path,
8282
content: entry.content,
8383
})
8484
}
@@ -246,7 +246,10 @@ mod tests {
246246
#[case] path: &str,
247247
#[case] validation: impl Fn(Result<FileEntry, serde_yaml::Error>) -> bool,
248248
) {
249-
let yaml = format!("path: \"{}\"\ncontent: \"some random content\"", path);
249+
let yaml = format!(
250+
"relative_path: \"{}\"\ncontent: \"some random content\"",
251+
path
252+
);
250253
let parsed = serde_yaml::from_str::<FileEntry>(&yaml);
251254
let parsed_display = format!("{parsed:?}");
252255
assert!(validation(parsed), "{}", parsed_display);

0 commit comments

Comments
 (0)