Skip to content

Commit

Permalink
add 10000 ports for contribs api
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Jan 27, 2022
1 parent 7981454 commit c760be0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mpcontribs-client/mpcontribs/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions mpcontribs-client/mpcontribs/client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c760be0

Please sign in to comment.