Skip to content

Commit

Permalink
chore: Merge branch 'sort-columns' of https://github.com/usnistgov/di…
Browse files Browse the repository at this point in the history
…optra into sort-columns
  • Loading branch information
henrychoy committed Sep 12, 2024
2 parents afbf8a0 + 697b407 commit 1228be9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/dioptra/restapi/v1/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# ACCESS THE FULL CC BY 4.0 LICENSE HERE:
# https://creativecommons.org/licenses/by/4.0/legalcode
"""Utility functions to help in building responses from ORM models"""
from typing import Any, Callable, Final, TypedDict, cast, Optional
from typing import Any, Callable, Final, Optional, TypedDict, cast
from urllib.parse import urlencode, urlunparse

from marshmallow import Schema
Expand Down
40 changes: 25 additions & 15 deletions tests/unit/restapi/v1/test_plugin_parameter_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,21 +469,31 @@ def test_get_all_plugin_parameter_types(
@pytest.mark.parametrize(
"sortBy, descending , expected",
[
(None, None, [
"plugin_param_type1", "plugin_param_type2", "plugin_param_type3"
]),
("name", True, [
"plugin_param_type2", "plugin_param_type3", "plugin_param_type1"
]),
("name", False, [
"plugin_param_type1", "plugin_param_type3", "plugin_param_type2"
]),
("createdOn", True, [
"plugin_param_type3", "plugin_param_type2", "plugin_param_type1"
]),
("createdOn", False, [
"plugin_param_type1", "plugin_param_type2", "plugin_param_type3"
]),
(
None,
None,
["plugin_param_type1", "plugin_param_type2", "plugin_param_type3"],
),
(
"name",
True,
["plugin_param_type2", "plugin_param_type3", "plugin_param_type1"],
),
(
"name",
False,
["plugin_param_type1", "plugin_param_type3", "plugin_param_type2"],
),
(
"createdOn",
True,
["plugin_param_type3", "plugin_param_type2", "plugin_param_type1"],
),
(
"createdOn",
False,
["plugin_param_type1", "plugin_param_type2", "plugin_param_type3"],
),
],
)
def test_plugin_parameter_type_sort(
Expand Down

0 comments on commit 1228be9

Please sign in to comment.