fix: tests should create valid urls
This commit is contained in:
parent
b3b8c0ec90
commit
1ef76dd7be
2 changed files with 7 additions and 4 deletions
|
@ -13,7 +13,8 @@ pub async fn status(
|
|||
let repo_details = &github.repo_details;
|
||||
let hostname = repo_details.forge.hostname();
|
||||
let repo_path = &repo_details.repo_path;
|
||||
let url = format!("https://api.{hostname}/repos/{repo_path}/commits/{commit}/statuses");
|
||||
let url = format!("https://api.{hostname}.net/repos/{repo_path}/commits/{commit}/statuses");
|
||||
tracing::debug!(?url, "get commit status");
|
||||
let Ok(response) = github
|
||||
.net
|
||||
.get(url)
|
||||
|
|
|
@ -108,7 +108,7 @@ mod github {
|
|||
macro_rules! status_tests{
|
||||
($($name:ident: $value:expr, )*) => {
|
||||
$(
|
||||
#[tokio::test]
|
||||
#[test_log::test(tokio::test)]
|
||||
async fn $name() {
|
||||
let (states, expected) = $value;
|
||||
let repo_details = given::repo_details();
|
||||
|
@ -557,8 +557,10 @@ mod github {
|
|||
repo_details: &git::RepoDetails,
|
||||
commit: &git::Commit,
|
||||
) {
|
||||
let url = a_commit_status_url(repo_details, commit);
|
||||
tracing::debug!(?url, "mock request");
|
||||
net.on()
|
||||
.get(a_commit_status_url(repo_details, commit))
|
||||
.get(url)
|
||||
.respond(StatusCode::OK)
|
||||
.body(
|
||||
json!(states
|
||||
|
@ -578,7 +580,7 @@ mod github {
|
|||
) -> String {
|
||||
let hostname = repo_details.forge.hostname();
|
||||
let repo_path = &repo_details.repo_path;
|
||||
format!("https://api.{hostname}/repos/{repo_path}/commits/{commit}/statuses")
|
||||
format!("https://api.{hostname}.net/repos/{repo_path}/commits/{commit}/statuses")
|
||||
}
|
||||
|
||||
pub fn a_webhook_auth() -> WebhookAuth {
|
||||
|
|
Loading…
Add table
Reference in a new issue