summaryrefslogtreecommitdiff
path: root/tests/api.py
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-07-14 09:17:16 +0200
committerpennae <github@quasiparticle.net>2022-07-14 09:17:16 +0200
commit062cd0ff0176f1f9924e3ae89c0eaf01a8d6fd04 (patch)
treec9d0409c5ec2aa60edad4ee590b746cb645208e7 /tests/api.py
parent566d6ccee21fc52943cf1862222f2e9a8927403c (diff)
downloadminor-skulk-062cd0ff0176f1f9924e3ae89c0eaf01a8d6fd04.tar.gz
minor-skulk-062cd0ff0176f1f9924e3ae89c0eaf01a8d6fd04.tar.xz
minor-skulk-062cd0ff0176f1f9924e3ae89c0eaf01a8d6fd04.zip
allow integration tests to run in parallel
this doesn't do much for performance, but it does allow running the tests with a simple `cargo t`.
Diffstat (limited to 'tests/api.py')
-rw-r--r--tests/api.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/api.py b/tests/api.py
index 9d2f70d..32e1159 100644
--- a/tests/api.py
+++ b/tests/api.py
@@ -15,12 +15,13 @@ from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
from fxa.crypto import quick_stretch_password, derive_key, xor
-AUTH_URL = "http://localhost:8000/auth"
-PROFILE_URL = "http://localhost:8000/profile"
-OAUTH_URL = "http://localhost:8000/oauth"
-INVITE_URL = "http://localhost:8000/_invite"
-PUSH_PORT = 10264
-SMTP_PORT = 2525
+API_PORT = int(os.environ.get('API_PORT', 8000))
+PUSH_PORT = API_PORT + 1
+SMTP_PORT = int(os.environ.get('MAIL_PORT', 2525))
+AUTH_URL = f"http://localhost:{API_PORT}/auth"
+PROFILE_URL = f"http://localhost:{API_PORT}/profile"
+OAUTH_URL = f"http://localhost:{API_PORT}/oauth"
+INVITE_URL = f"http://localhost:{API_PORT}/_invite"
def auth_pw(email, pw):
return derive_key(quick_stretch_password(email, pw), "authPW").hex()