diff --git a/tests/generate_release_notes_test.rs b/tests/generate_release_notes_test.rs index 0e80d6f2..ac1350d4 100644 --- a/tests/generate_release_notes_test.rs +++ b/tests/generate_release_notes_test.rs @@ -57,5 +57,5 @@ async fn should_return_page_with_check_runs() { let response = result.unwrap(); assert_eq!(response.name, tag_name); - assert_eq!(response.body.is_empty(), false); + assert!(!response.body.is_empty()); } diff --git a/tests/repos_commit_test.rs b/tests/repos_commit_test.rs index 8e7b1c52..aa240436 100644 --- a/tests/repos_commit_test.rs +++ b/tests/repos_commit_test.rs @@ -36,7 +36,7 @@ const REPO: &str = "some-repo"; #[tokio::test] async fn should_return_list_of_commits() { - let repos_list_commits_json: Vec:: = + let repos_list_commits_json: Vec = serde_json::from_str(include_str!("resources/repos_list_commits.json")).unwrap(); let template = ResponseTemplate::new(201).set_body_json(&repos_list_commits_json); let mock_server = setup_repos_commits_api(template).await; @@ -56,7 +56,7 @@ async fn should_return_list_of_commits() { let result = result.unwrap(); let result = result.items; - + assert!( result.len() == 1, "expected '1' for len(), got {:#?}", @@ -72,9 +72,24 @@ async fn should_return_list_of_commits() { ); assert!( - commit.commit.author.as_ref().unwrap().date.unwrap().to_rfc3339() == "2024-04-30T08:54:10+00:00", + commit + .commit + .author + .as_ref() + .unwrap() + .date + .unwrap() + .to_rfc3339() + == "2024-04-30T08:54:10+00:00", "expected '2024-04-30T08:54:10+00:00' value, got {:#?}", - commit.commit.author.as_ref().unwrap().date.unwrap().to_rfc3339() + commit + .commit + .author + .as_ref() + .unwrap() + .date + .unwrap() + .to_rfc3339() ); }); } diff --git a/tests/user_deserialize_test.rs b/tests/user_deserialize_test.rs index 11e70281..c91d8b26 100644 --- a/tests/user_deserialize_test.rs +++ b/tests/user_deserialize_test.rs @@ -2,9 +2,7 @@ mod mock_error; use mock_error::setup_error_handler; use octocrab::models::UserProfile; -use octocrab::{Error, Octocrab}; -use serde::{Deserialize, Serialize}; -use serde_json::{json, Value}; +use octocrab::Octocrab; use wiremock::{ matchers::{method, path}, Mock, MockServer, ResponseTemplate,