Skip to content

Commit

Permalink
fix: quotas query param name
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed May 29, 2024
1 parent 1a03ae4 commit 0b13f22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/registry/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl RegistryClient for RegistryHttpClient {
fn build_url(base_url: &Url, project_id: &str, quota: bool) -> Result<Url, url::ParseError> {
let mut url = base_url.join(&format!("/internal/project/key/{project_id}"))?;
if quota {
url.query_pairs_mut().append_pair("quota", "true");
url.query_pairs_mut().append_pair("quotas", "true");
}
Ok(url)
}
Expand Down Expand Up @@ -243,7 +243,7 @@ mod test {

Mock::given(method(Method::Get))
.and(path(format!("/internal/project/key/{project_id}")))
.and(query_param("quota", "true"))
.and(query_param("quotas", "true"))
.respond_with(
ResponseTemplate::new(StatusCode::OK).set_body_json(mock_project_data_quota()),
)
Expand Down Expand Up @@ -362,7 +362,7 @@ mod test {
let url = build_url(&base_url, &project_id, true).unwrap();
assert_eq!(
url.as_str(),
"http://example.com/internal/project/key/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?quota=true"
"http://example.com/internal/project/key/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?quotas=true"
);
}
}

0 comments on commit 0b13f22

Please sign in to comment.