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 repo_details = &github.repo_details;
|
||||||
let hostname = repo_details.forge.hostname();
|
let hostname = repo_details.forge.hostname();
|
||||||
let repo_path = &repo_details.repo_path;
|
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
|
let Ok(response) = github
|
||||||
.net
|
.net
|
||||||
.get(url)
|
.get(url)
|
||||||
|
|
|
@ -108,7 +108,7 @@ mod github {
|
||||||
macro_rules! status_tests{
|
macro_rules! status_tests{
|
||||||
($($name:ident: $value:expr, )*) => {
|
($($name:ident: $value:expr, )*) => {
|
||||||
$(
|
$(
|
||||||
#[tokio::test]
|
#[test_log::test(tokio::test)]
|
||||||
async fn $name() {
|
async fn $name() {
|
||||||
let (states, expected) = $value;
|
let (states, expected) = $value;
|
||||||
let repo_details = given::repo_details();
|
let repo_details = given::repo_details();
|
||||||
|
@ -557,8 +557,10 @@ mod github {
|
||||||
repo_details: &git::RepoDetails,
|
repo_details: &git::RepoDetails,
|
||||||
commit: &git::Commit,
|
commit: &git::Commit,
|
||||||
) {
|
) {
|
||||||
|
let url = a_commit_status_url(repo_details, commit);
|
||||||
|
tracing::debug!(?url, "mock request");
|
||||||
net.on()
|
net.on()
|
||||||
.get(a_commit_status_url(repo_details, commit))
|
.get(url)
|
||||||
.respond(StatusCode::OK)
|
.respond(StatusCode::OK)
|
||||||
.body(
|
.body(
|
||||||
json!(states
|
json!(states
|
||||||
|
@ -578,7 +580,7 @@ mod github {
|
||||||
) -> String {
|
) -> String {
|
||||||
let hostname = repo_details.forge.hostname();
|
let hostname = repo_details.forge.hostname();
|
||||||
let repo_path = &repo_details.repo_path;
|
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 {
|
pub fn a_webhook_auth() -> WebhookAuth {
|
||||||
|
|
Loading…
Add table
Reference in a new issue