|
1 | 1 | use aw_client_rust::AwClient; |
2 | | -use aw_models::{Bucket, Event}; |
| 2 | +use aw_models::Event; |
3 | 3 | use chrono::{DateTime, TimeDelta, Utc}; |
4 | 4 | use dirs::config_dir; |
5 | 5 | use env_logger::Env; |
@@ -96,18 +96,7 @@ fn get_config_path() -> Option<std::path::PathBuf> { |
96 | 96 |
|
97 | 97 | async fn create_bucket(aw_client: &AwClient) -> Result<(), Box<dyn std::error::Error>> { |
98 | 98 | let res = aw_client |
99 | | - .create_bucket(&Bucket { |
100 | | - id: "aw-watcher-lastfm".to_string(), |
101 | | - bid: None, |
102 | | - _type: "currently-playing".to_string(), |
103 | | - data: Map::new(), |
104 | | - metadata: Default::default(), |
105 | | - last_updated: None, |
106 | | - hostname: "".to_string(), |
107 | | - client: "aw-watcher-lastfm-rust".to_string(), |
108 | | - created: None, |
109 | | - events: None, |
110 | | - }) |
| 99 | + .create_bucket_simple("aw-watcher-lastfm", "currently-playing") |
111 | 100 | .await; |
112 | 101 | match res { |
113 | 102 | Ok(_) => Ok(()), |
@@ -396,11 +385,11 @@ mod tests { |
396 | 385 | assert_eq!(parse_time_string("7d"), Some(TimeDelta::days(7))); |
397 | 386 | assert_eq!(parse_time_string("24h"), Some(TimeDelta::hours(24))); |
398 | 387 | assert_eq!(parse_time_string("30m"), Some(TimeDelta::minutes(30))); |
399 | | - |
| 388 | + |
400 | 389 | // Test invalid inputs |
401 | 390 | assert_eq!(parse_time_string(""), None); |
402 | | - assert_eq!(parse_time_string("30s"), None); // Invalid unit |
403 | | - assert_eq!(parse_time_string("abc"), None); // Invalid format |
404 | | - assert_eq!(parse_time_string("-1d"), None); // Negative number |
| 391 | + assert_eq!(parse_time_string("30s"), None); // Invalid unit |
| 392 | + assert_eq!(parse_time_string("abc"), None); // Invalid format |
| 393 | + assert_eq!(parse_time_string("-1d"), None); // Negative number |
405 | 394 | } |
406 | 395 | } |
0 commit comments