Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LITE-28012 Add upload files functionality #12

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions connect_ext_ppr/webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from connect.client import ConnectClient
from connect.eaas.core.decorators import (
module_pages,
proxied_connect_api,
router,
web_app,
)
Expand Down Expand Up @@ -38,6 +39,11 @@
label='Deployments',
url='/static/index.html',
)
@proxied_connect_api(
{
'/public/v1/media': 'edit',
},
)
class ConnectExtensionXvsWebApplication(WebApplicationBase):

@router.get(
Expand Down
11 changes: 11 additions & 0 deletions tests/api/test_deployments.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
from connect.eaas.core.constants import PROXIED_CONNECT_API_ATTR_NAME


def test_proxied_connect_endpoints(api_client):
proxied = getattr(api_client._webapp_class, PROXIED_CONNECT_API_ATTR_NAME)
assert isinstance(proxied, dict)
assert proxied == {
'/public/v1/media': 'edit',
}

Copy link
Contributor

@Hairash Hairash Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also propose to add one more test to check the resulting url, because theoretically proxied_connect_api may change in future.
It's not crucial to implement it now, but I think it's good to add it one day. Do you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test here is to keep track of proxied endpoints that webapp currently have. Im not sure if full url could be tested from the api_client, because proxied_connect_api is a configuration for the runner.


def test_get_deployments(
mocker,
deployment,
Expand Down