cleanup comments
Unit Tests with docker compose and cargo / unit-test (push) Successful in 2m19s
Details
Unit Tests with docker compose and cargo / unit-test (push) Successful in 2m19s
Details
This commit is contained in:
parent
e9d332487d
commit
9b9ddc1d42
12
src/main.rs
12
src/main.rs
|
@ -65,7 +65,7 @@ struct Errors {
|
|||
retry: u8,
|
||||
}
|
||||
|
||||
#[tokio::main] // requires `features = ["mt"]
|
||||
#[tokio::main]
|
||||
async fn main() -> DynResult<()> {
|
||||
stderrlog::new()
|
||||
.module(module_path!())
|
||||
|
@ -175,8 +175,8 @@ fn generate_config() -> DynResult<()> {
|
|||
}
|
||||
|
||||
fn parse_config(filename: &str) -> DynResult<Config> {
|
||||
let toml_file = std::fs::read_to_string(filename)?; //.expect("No config file, consider getting the original one and modifing it");
|
||||
Ok(toml::from_str(&toml_file)?) //("Malformed config file, check the original one for reference")
|
||||
let toml_file = std::fs::read_to_string(filename)?;
|
||||
Ok(toml::from_str(&toml_file)?)
|
||||
}
|
||||
|
||||
async fn get_next_url(config: &Config) -> DynResult<Option<Image>> {
|
||||
|
@ -384,8 +384,8 @@ async fn register(client: &Client, config: &Config) {
|
|||
}
|
||||
|
||||
fn parse_mastodon_data(filename: &str) -> DynResult<MastodonData> {
|
||||
let toml_file = std::fs::read_to_string(filename)?; //.expect("No config file, consider getting the original one and modifing it");
|
||||
Ok(toml::from_str(&toml_file)?) //("Malformed config file, check the original one for reference")
|
||||
let toml_file = std::fs::read_to_string(filename)?;
|
||||
Ok(toml::from_str(&toml_file)?)
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
@ -598,7 +598,6 @@ mod tests {
|
|||
const IMAGE: &str = "https://picsum.photos/id/1";
|
||||
let expected = insert_image(&config, IMAGE).await.unwrap();
|
||||
|
||||
// Get test url
|
||||
let image = get_next_url(&config).await.unwrap().unwrap();
|
||||
assert_eq!(image.url, IMAGE);
|
||||
|
||||
|
@ -613,7 +612,6 @@ mod tests {
|
|||
let image = image.image;
|
||||
assert_eq!(image.status, "consumed");
|
||||
|
||||
// Test that now it does not get it
|
||||
let image = get_next_url(&config).await.unwrap();
|
||||
assert_eq!(image, None);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue