Skip to content

Commit

Permalink
Run cargo fmt & clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Jun 13, 2024
1 parent c798e03 commit 0b448bd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/generate_release_notes_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
23 changes: 19 additions & 4 deletions tests/repos_commit_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const REPO: &str = "some-repo";

#[tokio::test]
async fn should_return_list_of_commits() {
let repos_list_commits_json: Vec::<RepoCommit> =
let repos_list_commits_json: Vec<RepoCommit> =
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;
Expand All @@ -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 {:#?}",
Expand All @@ -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()
);
});
}
4 changes: 1 addition & 3 deletions tests/user_deserialize_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0b448bd

Please sign in to comment.