Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ class WalletGetPermissions(WalletGet):
)


class CreateWalletBodyParams(OutputSchema):
class CreateWalletBodyParams(InputSchema):
name: str
description: str | None = None
thumbnail: str | None = None


class PutWalletBodyParams(OutputSchema):
class PutWalletBodyParams(InputSchema):
name: str
description: str | None
thumbnail: str | None
thumbnail: str | None = None
status: WalletStatus


Expand Down
2 changes: 1 addition & 1 deletion services/web/server/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.65.0
0.65.1
6 changes: 3 additions & 3 deletions services/web/server/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.65.0
current_version = 0.65.1
commit = True
message = services/webserver api version: {current_version} → {new_version}
tag = False
Expand All @@ -13,13 +13,13 @@ commit_args = --no-verify
addopts = --strict-markers
asyncio_mode = auto
asyncio_default_fixture_loop_scope = function
markers =
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
acceptance_test: "marks tests as 'acceptance tests' i.e. does the system do what the user expects? Typically those are workflows."
testit: "marks test to run during development"
heavy_load: "mark tests that require large amount of data"

[mypy]
plugins =
plugins =
pydantic.mypy
sqlalchemy.ext.mypy.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.1.0
info:
title: simcore-service-webserver
description: Main service with an interface (http-API & websockets) to the web front-end
version: 0.65.0
version: 0.65.1
servers:
- url: ''
description: webserver
Expand Down Expand Up @@ -15248,7 +15248,6 @@ components:
required:
- name
- description
- thumbnail
- status
title: PutWalletBodyParams
RegisterBody:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,61 @@ async def test_get_default_wallet_access_rights(
status.HTTP_401_UNAUTHORIZED,
status.HTTP_403_FORBIDDEN,
), f"{error}"


@pytest.mark.parametrize("user_role,expected", [(UserRole.USER, status.HTTP_200_OK)])
async def test_update_wallet_without_thumbnail(
client: TestClient,
logged_user: UserInfoDict,
expected: HTTPStatus,
wallets_clean_db: AsyncIterator[None],
mock_rut_sum_total_available_credits_in_the_wallet: mock.Mock,
):
assert client.app

# Create a wallet first
url = client.app.router["create_wallet"].url_for()
resp = await client.post(
url.path,
json={
"name": "Test wallet",
"description": "Test description",
"thumbnail": "Initial thumbnail",
},
)
created_wallet, _ = await assert_status(resp, status.HTTP_201_CREATED)
assert created_wallet["thumbnail"] == "Initial thumbnail"

# Update the wallet without a thumbnail in the request body
url = client.app.router["update_wallet"].url_for(
wallet_id=f"{created_wallet['walletId']}"
)
resp = await client.put(
url.path,
json={
"name": "Updated wallet name",
"description": "Updated description",
"status": "ACTIVE",
},
)
updated_wallet, _ = await assert_status(resp, status.HTTP_200_OK)

# Verify that the thumbnail is set to None when not provided in the request
assert updated_wallet["walletId"] == created_wallet["walletId"]
assert updated_wallet["name"] == "Updated wallet name"
assert updated_wallet["description"] == "Updated description"
assert (
updated_wallet["thumbnail"] is None
) # Thumbnail should be None when not provided
assert updated_wallet["status"] == "ACTIVE"

# Get the wallet to verify the changes persisted
url = client.app.router["get_wallet"].url_for(
wallet_id=f"{created_wallet['walletId']}"
)
resp = await client.get(url.path)
fetched_wallet, _ = await assert_status(resp, status.HTTP_200_OK)

assert (
fetched_wallet["thumbnail"] is None
) # Confirm thumbnail is None in the database
Loading