diff options
author | Bartek Iwańczuk <biwanczuk@gmail.com> | 2023-12-15 11:27:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-15 10:27:10 +0000 |
commit | 62e3f5060ef9cc6a31b3e496dd15548c0abd07e6 (patch) | |
tree | e03148c86caebe8b23a8d5f04f9df9357769f7fb /test_util/src | |
parent | a1870c70a1adcd58798541aa965c915afa6f6c89 (diff) |
refactor: check if scope and package exist before publish (#21575)
Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Diffstat (limited to 'test_util/src')
-rw-r--r-- | test_util/src/servers/registry.rs | 9 |
1 files changed, 7 insertions, 2 deletions
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<Response<Body>, 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", |