Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import pytest

from tests_common.test_utils.asserts import assert_queries_count
from tests_common.test_utils.markers import skip_if_force_lowest_dependencies_marker

pytestmark = pytest.mark.db_test
Expand Down Expand Up @@ -61,15 +62,17 @@ class TestGetPlugins:
def test_should_respond_200(
self, test_client, session, query_params, expected_total_entries, expected_names
):
response = test_client.get("/plugins", params=query_params)
with assert_queries_count(2):
response = test_client.get("/plugins", params=query_params)
assert response.status_code == 200

body = response.json()
assert body["total_entries"] == expected_total_entries
assert [plugin["name"] for plugin in body["plugins"]] == expected_names

def test_external_views_model_validator(self, test_client):
response = test_client.get("plugins")
with assert_queries_count(2):
response = test_client.get("plugins")
body = response.json()

test_plugin = next((plugin for plugin in body["plugins"] if plugin["name"] == "test_plugin"), None)
Expand Down Expand Up @@ -163,7 +166,8 @@ class TestGetPluginImportErrors:
new={"plugins/test_plugin.py": "something went wrong"},
)
def test_should_respond_200(self, test_client, session):
response = test_client.get("/plugins/importErrors")
with assert_queries_count(2):
response = test_client.get("/plugins/importErrors")
assert response.status_code == 200

body = response.json()
Expand Down
Loading