Skip to content

Commit

Permalink
test: fix broken testcases after the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-bozbei-ew committed Sep 1, 2023
1 parent b20a9a6 commit e1c33af
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Adapter:
...

app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

assert app.url_path_for("get_versions") == "/ocpi/versions"
2 changes: 1 addition & 1 deletion tests/test_modules/mocks/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from py_ocpi.core.endpoints import ENDPOINTS
from py_ocpi.core.enums import RoleEnum
from py_ocpi.modules.versions.enums import VersionNumber
from py_ocpi.modules.versions.schemas import VersionDetail
from py_ocpi.modules.versions.v_2_2_1.schemas import VersionDetail

fake_endpoints_data = {
"data": [
Expand Down
6 changes: 3 additions & 3 deletions tests/test_modules/test_cdrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def cdr_adapter(

def test_cpo_get_cdrs_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -114,7 +114,7 @@ def test_cpo_get_cdrs_v_2_2_1():

def test_emsp_get_cdr_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -126,7 +126,7 @@ def test_emsp_get_cdr_v_2_2_1():

def test_emsp_add_cdr_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

data = CDRS[0]
Expand Down
10 changes: 5 additions & 5 deletions tests/test_modules/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def command_result_adapter(

def test_cpo_receive_command_start_session_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

data = {
Expand Down Expand Up @@ -107,7 +107,7 @@ def test_cpo_receive_command_start_session_v_2_2_1():

def test_cpo_receive_command_stop_session_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

data = {
Expand All @@ -127,7 +127,7 @@ def test_cpo_receive_command_stop_session_v_2_2_1():

def test_cpo_receive_command_reserve_now_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

data = {
Expand Down Expand Up @@ -174,7 +174,7 @@ async def get(
Crud.get = get

app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

data = {
Expand Down Expand Up @@ -211,7 +211,7 @@ async def get(

def test_emsp_receive_command_result_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_modules/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def credentials_adapter(

def test_cpo_get_credentials_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)
token = str(uuid4())
header = {"Authorization": f"Token {encode_string_base64(token)}"}
Expand Down Expand Up @@ -126,7 +126,7 @@ async def do(
return {}

app_1 = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], MockCrud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], MockCrud, Adapter
)

def override_get_versions():
Expand All @@ -144,7 +144,7 @@ def override_get_versions():
async_client.return_value = AsyncClient(app=app_1, base_url="http://test")

app_2 = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], MockCrud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], MockCrud, Adapter
)

async with AsyncClient(app=app_2, base_url="http://test") as client:
Expand Down
26 changes: 13 additions & 13 deletions tests/test_modules/test_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def location_adapter(

def test_cpo_get_locations_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -248,7 +248,7 @@ def test_cpo_get_locations_v_2_2_1():

def test_cpo_get_location_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -260,7 +260,7 @@ def test_cpo_get_location_v_2_2_1():

def test_cpo_get_evse_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -275,7 +275,7 @@ def test_cpo_get_evse_v_2_2_1():

def test_cpo_get_connector_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -294,7 +294,7 @@ def test_cpo_get_connector_v_2_2_1():

def test_emsp_get_location_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -309,7 +309,7 @@ def test_emsp_get_location_v_2_2_1():

def test_emsp_get_evse_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -325,7 +325,7 @@ def test_emsp_get_evse_v_2_2_1():

def test_emsp_get_connector_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -345,7 +345,7 @@ def test_emsp_get_connector_v_2_2_1():

def test_emsp_add_location_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -361,7 +361,7 @@ def test_emsp_add_location_v_2_2_1():

def test_emsp_add_evse_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -378,7 +378,7 @@ def test_emsp_add_evse_v_2_2_1():

def test_emsp_add_connector_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -399,7 +399,7 @@ def test_emsp_add_connector_v_2_2_1():

def test_emsp_patch_location_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

patch_data = {"id": str(uuid4())}
Expand All @@ -416,7 +416,7 @@ def test_emsp_patch_location_v_2_2_1():

def test_emsp_patch_evse_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

patch_data = {"uid": str(uuid4())}
Expand All @@ -434,7 +434,7 @@ def test_emsp_patch_evse_v_2_2_1():

def test_emsp_patch_connector_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

patch_data = {"id": str(uuid4())}
Expand Down
10 changes: 5 additions & 5 deletions tests/test_modules/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def charging_preference_adapter(

def test_cpo_get_sessions_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -124,7 +124,7 @@ def test_cpo_get_sessions_v_2_2_1():

def test_cpo_set_charging_preference_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -143,7 +143,7 @@ def test_cpo_set_charging_preference_v_2_2_1():

def test_emsp_get_session_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -158,7 +158,7 @@ def test_emsp_get_session_v_2_2_1():

def test_emsp_add_session_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -174,7 +174,7 @@ def test_emsp_add_session_v_2_2_1():

def test_emsp_patch_session_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

patch_data = {"id": str(uuid4())}
Expand Down
8 changes: 4 additions & 4 deletions tests/test_modules/test_tariffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def tariff_adapter(

def test_cpo_get_tariffs_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -98,7 +98,7 @@ def test_cpo_get_tariffs_v_2_2_1():

def test_emsp_get_tariff_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -113,7 +113,7 @@ def test_emsp_get_tariff_v_2_2_1():

def test_emsp_add_tariff_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -129,7 +129,7 @@ def test_emsp_add_tariff_v_2_2_1():

def test_emsp_delete_tariff_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand Down
14 changes: 7 additions & 7 deletions tests/test_modules/test_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def authorization_adapter(

def test_cpo_get_token_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -132,7 +132,7 @@ def test_cpo_get_token_v_2_2_1():

def test_cpo_add_token_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -149,7 +149,7 @@ def test_cpo_add_token_v_2_2_1():

def test_cpo_update_token_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -169,7 +169,7 @@ def test_cpo_update_token_v_2_2_1():

def test_emsp_get_tokens_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand All @@ -182,7 +182,7 @@ def test_emsp_get_tokens_v_2_2_1():

def test_emsp_authorize_token_success_v_2_2_1():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand Down Expand Up @@ -211,7 +211,7 @@ async def get(
Crud.get = get

app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand Down Expand Up @@ -243,7 +243,7 @@ async def do(
Crud.do = do

app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.emsp], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.emsp], Crud, Adapter
)

client = TestClient(app)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_modules/test_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def test_get_versions():
app = get_application(
VersionNumber.v_2_2_1, [enums.RoleEnum.cpo], Crud, Adapter
[VersionNumber.v_2_2_1], [enums.RoleEnum.cpo], Crud, Adapter
)

client = TestClient(app)
Expand Down

0 comments on commit e1c33af

Please sign in to comment.