Skip to content

Commit

Permalink
run black, fix requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Ainsworth committed Apr 19, 2024
1 parent d800447 commit b45eebf
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 24 deletions.
28 changes: 14 additions & 14 deletions integration_tests/v1/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@
from jsonschema import validate, exceptions
from requests_aws4auth import AWS4Auth

# TODO needs to come from an env var
data_lpa_url_root = "https://uml2734a.dev.lpa.api.opg.service.justice.gov.uk/v1"
healthcheck_url = f"{data_lpa_url_root}/healthcheck"
online_tool_url = f"{data_lpa_url_root}/lpa-online-tool/lpas"
use_an_lpa_url = f"{data_lpa_url_root}/use-an-lpa/lpas"
request_code_url = f"{data_lpa_url_root}/use-an-lpa/lpas/requestCode"
BRANCH_NAME = os.getenv("BRANCH_NAME")
DATA_LPA_URL_ROOT = f"https://{BRANCH_NAME}.dev.lpa.api.opg.service.justice.gov.uk/v1"
HEALTHCHECK_URL = f"{DATA_LPA_URL_ROOT}/healthcheck"
ONLINE_TOOL_URL = f"{DATA_LPA_URL_ROOT}/lpa-online-tool/lpas"
USE_AN_LPA_URL = f"{DATA_LPA_URL_ROOT}/use-an-lpa/lpas"
REQUEST_CODE_URL = f"{DATA_LPA_URL_ROOT}/use-an-lpa/lpas/requestCode"

opg_data_lpa_dev_aws = {
"name": "new collections api on aws dev",
"healthcheck_endpoint": {
"url": healthcheck_url,
"url": HEALTHCHECK_URL,
"method": "GET",
},
"online_tool_endpoint": {
"url": online_tool_url,
"url": ONLINE_TOOL_URL,
"method": "GET",
"valid_lpa_online_tool_ids": ["A33718377316"],
"invalid_lpa_online_tool_ids": ["banana"],
},
"use_an_lpa_endpoint": {
"url": use_an_lpa_url,
"url": USE_AN_LPA_URL,
"method": "GET",
"valid_sirius_uids": ["700000000047"],
"invalid_sirius_uids": ["9"],
},
"request_code_endpoint": {
"url": request_code_url,
"url": REQUEST_CODE_URL,
"method": "POST",
"valid_sirius_lpas": [
{"caseUid": 700000000013, "actorUid": 700000000997},
Expand All @@ -47,23 +47,23 @@
opg_data_lpa_local_mock = {
"name": "new collections api local mock",
"healthcheck_endpoint": {
"url": "http://0.0.0.0:4343/v1/healthcheck",
"url": "http://127.0.0.1:4343/v1/healthcheck",
"method": "GET",
},
"online_tool_endpoint": {
"url": "http://0.0.0.0:4343/v1/lpa-online-tool/lpas",
"url": "http://127.0.0.1:4343/v1/lpa-online-tool/lpas",
"method": "GET",
"valid_lpa_online_tool_ids": ["A39721583862"],
"invalid_lpa_online_tool_ids": ["banana"],
},
"use_an_lpa_endpoint": {
"url": "http://0.0.0.0:4343/v1/use-an-lpa/lpas",
"url": "http://127.0.01:4343/v1/use-an-lpa/lpas",
"method": "GET",
"valid_sirius_uids": ["700000000138"],
"invalid_sirius_uids": ["9"],
},
"request_code_endpoint": {
"url": "http://0.0.0.0:4343/v1/use-an-lpa/lpas/requestCode",
"url": "http://127.0.0.1:4343/v1/use-an-lpa/lpas/requestCode",
"method": "POST",
"valid_sirius_lpas": [
{"caseUid": 700000000138, "actorUid": 700000000997},
Expand Down
4 changes: 3 additions & 1 deletion integration_tests/v1/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ pytest-xdist==3.5.0
pytest-html==4.1.1
requests_aws4auth==1.2.3
boto3==1.34.87
jsonschema==4.21.1
jsonschema==4.21.1
fakeredis==2.21.3
flask==3.0.3
2 changes: 0 additions & 2 deletions integration_tests/v1/test_healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
@pytest.mark.smoke_test
@pytest.mark.parametrize("test_config", configs_to_test)
def test_healthcheck_route(test_config):

if test_config["name"] == "original collections api on aws dev":
print("Healthcheck does not exist on original collections api on aws dev")
pass
else:

status, response = send_a_request(
test_config=test_config,
url=f"{test_config['healthcheck_endpoint']['url']}",
Expand Down
2 changes: 0 additions & 2 deletions integration_tests/v1/test_lpa_online_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@pytest.mark.smoke_test
@pytest.mark.parametrize("test_config", configs_to_test)
def test_online_tool_route(test_config):

for valid_id in test_config["online_tool_endpoint"]["valid_lpa_online_tool_ids"]:
status, response = send_a_request(
test_config=test_config,
Expand All @@ -23,7 +22,6 @@ def test_online_tool_route(test_config):
@pytest.mark.smoke_test
@pytest.mark.parametrize("test_config", configs_to_test)
def test_online_tool_route_invalid_id(test_config):

for valid_id in test_config["online_tool_endpoint"]["invalid_lpa_online_tool_ids"]:
status, response = send_a_request(
test_config=test_config,
Expand Down
5 changes: 2 additions & 3 deletions integration_tests/v1/test_request_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
@pytest.mark.smoke_test
@pytest.mark.parametrize("test_config", configs_to_test)
def test_request_code_route(test_config):

for lpa in test_config["request_code_endpoint"]["valid_sirius_lpas"]:
status, response = send_a_request(
test_config=test_config,
url=f"{test_config['request_code_endpoint']['url']}",
method=test_config["request_code_endpoint"]["method"],
payload={"case_uid": lpa['caseUid'], "actor_uid": lpa['actorUid']}
payload={"case_uid": lpa["caseUid"], "actor_uid": lpa["actorUid"]},
)

assert status == 204
assert status == 204
2 changes: 0 additions & 2 deletions integration_tests/v1/test_use_an_lpa.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@pytest.mark.smoke_test
@pytest.mark.parametrize("test_config", configs_to_test)
def test_use_an_lpa_route(test_config):

for valid_id in test_config["use_an_lpa_endpoint"]["valid_sirius_uids"]:
status, response = send_a_request(
test_config=test_config,
Expand All @@ -24,7 +23,6 @@ def test_use_an_lpa_route(test_config):
@pytest.mark.smoke_test
@pytest.mark.parametrize("test_config", configs_to_test)
def test_use_an_lpa_route_invalid_id(test_config):

for valid_id in test_config["use_an_lpa_endpoint"]["invalid_sirius_uids"]:
status, response = send_a_request(
test_config=test_config,
Expand Down

0 comments on commit b45eebf

Please sign in to comment.