update tests to use Default::default
impls for query types
This commit is contained in:
parent
f029ba5737
commit
a694ab48ff
|
@ -24,20 +24,14 @@ async fn user() {
|
||||||
"result of `myself` does not match result of `get_user`"
|
"result of `myself` does not match result of `get_user`"
|
||||||
);
|
);
|
||||||
|
|
||||||
let query = UserListFollowingQuery {
|
let query = UserListFollowingQuery::default();
|
||||||
page: None,
|
|
||||||
limit: None,
|
|
||||||
};
|
|
||||||
let following = api
|
let following = api
|
||||||
.user_list_following("TestingAdmin", query)
|
.user_list_following("TestingAdmin", query)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(following, Vec::new(), "following list not empty");
|
assert_eq!(following, Vec::new(), "following list not empty");
|
||||||
|
|
||||||
let query = UserListFollowersQuery {
|
let query = UserListFollowersQuery::default();
|
||||||
page: None,
|
|
||||||
limit: None,
|
|
||||||
};
|
|
||||||
let followers = api
|
let followers = api
|
||||||
.user_list_followers("TestingAdmin", query)
|
.user_list_followers("TestingAdmin", query)
|
||||||
.await
|
.await
|
||||||
|
@ -168,12 +162,7 @@ async fn repo() {
|
||||||
.await
|
.await
|
||||||
.is_ok();
|
.is_ok();
|
||||||
assert!(!is_merged, "pr should not yet be merged");
|
assert!(!is_merged, "pr should not yet be merged");
|
||||||
let pr_files_query = RepoGetPullRequestFilesQuery {
|
let pr_files_query = RepoGetPullRequestFilesQuery::default();
|
||||||
skip_to: None,
|
|
||||||
whitespace: None,
|
|
||||||
page: None,
|
|
||||||
limit: None,
|
|
||||||
};
|
|
||||||
let (_, _) = api
|
let (_, _) = api
|
||||||
.repo_get_pull_request_files("TestingAdmin", "test", pr.number.unwrap(), pr_files_query)
|
.repo_get_pull_request_files("TestingAdmin", "test", pr.number.unwrap(), pr_files_query)
|
||||||
.await
|
.await
|
||||||
|
@ -199,13 +188,7 @@ async fn repo() {
|
||||||
let _ = git().args(["fetch"]).status().unwrap();
|
let _ = git().args(["fetch"]).status().unwrap();
|
||||||
let _ = git().args(["pull"]).status().unwrap();
|
let _ = git().args(["pull"]).status().unwrap();
|
||||||
|
|
||||||
let query = RepoListReleasesQuery {
|
let query = RepoListReleasesQuery::default();
|
||||||
draft: None,
|
|
||||||
pre_release: None,
|
|
||||||
per_page: None,
|
|
||||||
page: None,
|
|
||||||
limit: None,
|
|
||||||
};
|
|
||||||
assert!(
|
assert!(
|
||||||
api.repo_list_releases("TestingAdmin", "test", query)
|
api.repo_list_releases("TestingAdmin", "test", query)
|
||||||
.await
|
.await
|
||||||
|
@ -332,12 +315,7 @@ async fn admin() {
|
||||||
.await
|
.await
|
||||||
.expect("failed to create user");
|
.expect("failed to create user");
|
||||||
|
|
||||||
let query = AdminSearchUsersQuery {
|
let query = AdminSearchUsersQuery::default();
|
||||||
source_id: None,
|
|
||||||
login_name: None,
|
|
||||||
page: None,
|
|
||||||
limit: None,
|
|
||||||
};
|
|
||||||
let users = api
|
let users = api
|
||||||
.admin_search_users(query)
|
.admin_search_users(query)
|
||||||
.await
|
.await
|
||||||
|
@ -349,10 +327,7 @@ async fn admin() {
|
||||||
.is_some(),
|
.is_some(),
|
||||||
"could not find new user"
|
"could not find new user"
|
||||||
);
|
);
|
||||||
let query = AdminGetAllEmailsQuery {
|
let query = AdminGetAllEmailsQuery::default();
|
||||||
page: None,
|
|
||||||
limit: None,
|
|
||||||
};
|
|
||||||
let users = api
|
let users = api
|
||||||
.admin_get_all_emails(query)
|
.admin_get_all_emails(query)
|
||||||
.await
|
.await
|
||||||
|
@ -379,10 +354,7 @@ async fn admin() {
|
||||||
.admin_create_org("Pipis", org_opt)
|
.admin_create_org("Pipis", org_opt)
|
||||||
.await
|
.await
|
||||||
.expect("failed to create org");
|
.expect("failed to create org");
|
||||||
let query = AdminGetAllOrgsQuery {
|
let query = AdminGetAllOrgsQuery::default();
|
||||||
page: None,
|
|
||||||
limit: None,
|
|
||||||
};
|
|
||||||
assert!(
|
assert!(
|
||||||
!api.admin_get_all_orgs(query).await.unwrap().is_empty(),
|
!api.admin_get_all_orgs(query).await.unwrap().is_empty(),
|
||||||
"org list empty"
|
"org list empty"
|
||||||
|
@ -417,10 +389,7 @@ async fn admin() {
|
||||||
"deleting fake user should fail"
|
"deleting fake user should fail"
|
||||||
);
|
);
|
||||||
|
|
||||||
let query = AdminCronListQuery {
|
let query = AdminCronListQuery::default();
|
||||||
page: None,
|
|
||||||
limit: None,
|
|
||||||
};
|
|
||||||
let crons = api
|
let crons = api
|
||||||
.admin_cron_list(query)
|
.admin_cron_list(query)
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Reference in a new issue