Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit 9a8495e

Browse files
committed
fix: failing test, read config from str instead
1 parent f48a360 commit 9a8495e

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

sonata.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ port = 3012
1010
host = "0.0.0.0"
1111
tls = false
1212

13+
[general]
14+
server_domain = "localhost"
15+
1316
[general.database]
1417
max_connections = 20
1518
database = "sonata"

src/config/mod.rs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -287,31 +287,11 @@ mod tests {
287287

288288
#[test]
289289
fn test_sonata_config_init() {
290-
let toml_str = r#"
291-
[api]
292-
enabled = true
293-
port = 3011
294-
host = "0.0.0.0"
295-
tls = false
290+
let toml_str =
291+
&std::fs::read_to_string(format!("{}/sonata.toml", std::env!("CARGO_MANIFEST_DIR")))
292+
.unwrap();
296293

297-
[gateway]
298-
enabled = true
299-
port = 3012
300-
host = "0.0.0.0"
301-
tls = false
302-
303-
[general]
304-
log_level = "Trace"
305-
306-
[general.database]
307-
max_connections = 20
308-
database = "sonata"
309-
username = "sonata"
310-
password = "sonata"
311-
port = 5432
312-
host = "localhost"
313-
tls = "prefer"
314-
"#;
294+
let _config: SonataConfig = toml::from_str(&toml_str).unwrap();
315295

316296
// First init should succeed
317297
assert!(SonataConfig::init(toml_str).is_ok());

0 commit comments

Comments
 (0)