Skip to content

Commit a373fc8

Browse files
committed
#812 Fixed tests, found a bug also
1 parent 41386ed commit a373fc8

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/backend_api/app/api/routes/modifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ async def update_modifier(
167167

168168

169169
@router.delete(
170-
"/{modifierId}",
170+
"/",
171171
response_model=str,
172172
dependencies=[Depends(get_current_active_superuser)],
173173
)

src/backend_api/app/tests/test_simulating_env/api/api_routes_test_base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,11 +730,14 @@ async def test_delete_instance_not_enough_permissions(
730730
response = await async_client.delete(
731731
f"{settings.API_V1_STR}/{route_prefix}/", params=obj_out_pk_map
732732
)
733+
content = response.json()
734+
print(content["detail"], "badsad")
733735
invalid_token_error = InvalidTokenError(
734736
token=None,
735737
function_name=UserCache.verify_token.__name__,
736738
class_name=UserCache.__name__,
737739
)
740+
print(response.status_code, invalid_token_error.status_code)
738741
assert response.status_code == invalid_token_error.status_code
739742
content = response.json()
740743
assert content["detail"] == invalid_token_error.detail

src/backend_api/app/tests/test_simulating_env/api/api_test_rate_limit_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async def perform_time_interval_requests_with_api_function(
6868
# print(
6969
# f"{response.status_code} | {i} | {request_amount} | ResponseJson: {response.json()}"
7070
# )
71-
assert response.status_code == 200 if i < request_amount else 429
71+
assert response.status_code == (200 if i < request_amount else 429)
7272
await asyncio.sleep(skip_time)
7373

7474
# if i >= request_amount:

src/backend_api/app/tests/utils/model_utils/item_modifier.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ async def create_random_item_modifier_dict(
4545
itemId = item.itemId
4646
modifier_dict, modifier = await generate_random_modifier(db)
4747
modifierId = modifier.modifierId
48+
position = modifier.position
4849

4950
item_modifier_dict = {
5051
"itemId": itemId,
5152
"modifierId": modifierId,
53+
"position": position,
5254
"roll": roll_value,
5355
"createdHoursSinceLaunch": random_int(small_int=True),
5456
}

src/backend_api/app/tests/utils/model_utils/plot.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ async def create_minimal_random_plot_query_dict(db: Session) -> dict[str, Any]:
4545
}
4646

4747
wanted_modifiers = [
48-
[
49-
{
50-
"modifierId": modifier_dep.modifierId,
51-
}
52-
]
48+
{
49+
"modifierId": modifier_dep.modifierId,
50+
}
5351
]
5452

5553
plot_query = {

0 commit comments

Comments
 (0)