From c760be095bd17337aef002b39e50076618d15df1 Mon Sep 17 00:00:00 2001 From: Patrick Huck Date: Thu, 27 Jan 2022 12:58:58 -0800 Subject: [PATCH] add 10000 ports for contribs api --- mpcontribs-client/mpcontribs/client/__init__.py | 2 +- mpcontribs-client/mpcontribs/client/test_client.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mpcontribs-client/mpcontribs/client/__init__.py b/mpcontribs-client/mpcontribs/client/__init__.py index 747ce36ef..4c26f0f94 100644 --- a/mpcontribs-client/mpcontribs/client/__init__.py +++ b/mpcontribs-client/mpcontribs/client/__init__.py @@ -64,7 +64,7 @@ PROVIDERS = {"github", "google", "facebook", "microsoft", "amazon"} COMPONENTS = ["structures", "tables", "attachments"] # using list to maintain order SUBDOMAINS = ["contribs", "lightsources", "ml", "workshop-contribs"] -PORTS = [5000, 5002, 5003, 5005] +PORTS = [5000, 5002, 5003, 5005, 10000, 10002, 10003, 10005] VALID_URLS = {f"http://{h}:{p}" for p in PORTS for h in ["localhost", "contribs-apis"]} VALID_URLS |= { f"https://{n}-api{m}.materialsproject.org" diff --git a/mpcontribs-client/mpcontribs/client/test_client.py b/mpcontribs-client/mpcontribs/client/test_client.py index 07ede1ba8..dd7ba103e 100644 --- a/mpcontribs-client/mpcontribs/client/test_client.py +++ b/mpcontribs-client/mpcontribs/client/test_client.py @@ -23,21 +23,21 @@ def test_Client(): assert spec.spec_dict["schemes"] == ["https"] assert spec.user_defined_formats["email"] == email_format - kwargs = {"headers": {"a": "b"}, "host": "localhost:5000"} + kwargs = {"headers": {"a": "b"}, "host": "localhost:10000"} spec = Client(**kwargs).swagger_spec assert spec.http_client.headers == { "Content-Type": "application/json", "a": "b" } - assert spec.origin_url == "http://localhost:5000/apispec.json" - assert spec.spec_dict["host"] == "localhost:5000" + assert spec.origin_url == "http://localhost:10000/apispec.json" + assert spec.spec_dict["host"] == "localhost:10000" assert spec.spec_dict["schemes"] == ["http"] assert spec.user_defined_formats["email"] == email_format - kwargs = {"host": "contribs-apis:5000"} + kwargs = {"host": "contribs-apis:10000"} spec = Client(**kwargs).swagger_spec assert spec.http_client.headers == {"Content-Type": "application/json"} - assert spec.origin_url == "http://contribs-apis:5000/apispec.json" - assert spec.spec_dict["host"] == "contribs-apis:5000" + assert spec.origin_url == "http://contribs-apis:10000/apispec.json" + assert spec.spec_dict["host"] == "contribs-apis:10000" assert spec.spec_dict["schemes"] == ["http"] assert spec.user_defined_formats["email"] == email_format