-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from husqvarnagroup/mm/version-sorting
Fix sorting software by version
- Loading branch information
Showing
14 changed files
with
130 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import pytest | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_list_devices_uuid_asc(async_client, test_data): | ||
response = await async_client.get(f"/ui/bff/devices?order[0][dir]=asc&order[0][name]=uuid") | ||
|
||
assert response.status_code == 200 | ||
devices = response.json()["data"] | ||
assert len(devices) == 2 | ||
assert devices[0]["uuid"] == test_data["device_rollout"].uuid | ||
assert devices[1]["uuid"] == test_data["device_assigned"].uuid | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_list_devices_uuid_desc(async_client, test_data): | ||
response = await async_client.get(f"/ui/bff/devices?order[0][dir]=desc&order[0][name]=uuid") | ||
|
||
assert response.status_code == 200 | ||
devices = response.json()["data"] | ||
assert len(devices) == 2 | ||
assert devices[0]["uuid"] == test_data["device_assigned"].uuid | ||
assert devices[1]["uuid"] == test_data["device_rollout"].uuid |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pytest | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_list_software_version_asc(async_client, test_data): | ||
response = await async_client.get(f"/ui/bff/software?order[0][dir]=asc&order[0][name]=version") | ||
|
||
assert response.status_code == 200 | ||
software = response.json()["data"] | ||
assert len(software) == 3 | ||
assert software[0]["version"] == test_data["software_beta"].version | ||
assert software[1]["version"] == test_data["software_rc"].version | ||
assert software[2]["version"] == test_data["software_release"].version | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_list_software_version_desc(async_client, test_data): | ||
response = await async_client.get(f"/ui/bff/software?order[0][dir]=desc&order[0][name]=version") | ||
|
||
assert response.status_code == 200 | ||
software = response.json()["data"] | ||
assert len(software) == 3 | ||
assert software[0]["version"] == test_data["software_release"].version | ||
assert software[1]["version"] == test_data["software_rc"].version | ||
assert software[2]["version"] == test_data["software_beta"].version |