From 62e3f5060ef9cc6a31b3e496dd15548c0abd07e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 15 Dec 2023 11:27:10 +0100 Subject: refactor: check if scope and package exist before publish (#21575) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bartek IwaƄczuk Co-authored-by: Luca Casonato --- test_util/src/servers/registry.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test_util') diff --git a/test_util/src/servers/registry.rs b/test_util/src/servers/registry.rs index 6bb2cf1fc..56a9e31b0 100644 --- a/test_util/src/servers/registry.rs +++ b/test_util/src/servers/registry.rs @@ -28,7 +28,12 @@ async fn registry_server_handler( ) -> Result, hyper::http::Error> { let path = req.uri().path(); - if path.starts_with("/scopes/") { + // TODO(bartlomieju): add a proper router here + if path.starts_with("/api/scope/") { + let body = serde_json::to_string_pretty(&json!({})).unwrap(); + let res = Response::new(Body::from(body)); + return Ok(res); + } else if path.starts_with("/api/scopes/") { let body = serde_json::to_string_pretty(&json!({ "id": "sdfwqer-sffg-qwerasdf", "status": "success", @@ -37,7 +42,7 @@ async fn registry_server_handler( .unwrap(); let res = Response::new(Body::from(body)); return Ok(res); - } else if path.starts_with("/publish_status/") { + } else if path.starts_with("/api/publish_status/") { let body = serde_json::to_string_pretty(&json!({ "id": "sdfwqer-qwer-qwerasdf", "status": "success", -- cgit v1.2.3