mirror of
https://github.com/openai/codex.git
synced 2026-05-06 06:12:59 +03:00
test: serialize local marketplace config in metadata test
This commit is contained in:
@@ -296,12 +296,22 @@ mod tests {
|
||||
r#"{"name":"debug","plugins":[]}"#,
|
||||
)
|
||||
.unwrap();
|
||||
let mut marketplace = toml::map::Map::new();
|
||||
marketplace.insert(
|
||||
"source_type".to_string(),
|
||||
toml::Value::String("local".to_string()),
|
||||
);
|
||||
marketplace.insert(
|
||||
"source".to_string(),
|
||||
toml::Value::String(source_root.display().to_string()),
|
||||
);
|
||||
let mut marketplaces = toml::map::Map::new();
|
||||
marketplaces.insert("debug".to_string(), toml::Value::Table(marketplace));
|
||||
let mut config = toml::map::Map::new();
|
||||
config.insert("marketplaces".to_string(), toml::Value::Table(marketplaces));
|
||||
fs::write(
|
||||
codex_home.path().join(CONFIG_TOML_FILE),
|
||||
format!(
|
||||
"[marketplaces.debug]\nsource_type = \"local\"\nsource = \"{}\"\n",
|
||||
source_root.display()
|
||||
),
|
||||
toml::to_string(&toml::Value::Table(config)).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user