Skip to content

Commit

Permalink
test: update archivefiles tests for no group users, add config for py…
Browse files Browse the repository at this point in the history
…test

The archivefiles service has been changed to returned different files for no group users and internal users.
The import mode of pytest is suggested at https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#tests-outside-application-code
  • Loading branch information
kan-fu committed Dec 8, 2023
1 parent 3043736 commit 658bb92
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ select = [
exclude = [
"tests/robot",
]

[tool.pytest.ini_options]
testpaths = [
"tests",
]
addopts = [
"--import-mode=importlib",
]
2 changes: 2 additions & 0 deletions src/onc/modules/_OncService.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import weakref
from time import time
from urllib import parse
Expand Down
6 changes: 3 additions & 3 deletions tests/robot/suites/09__archivefiles.robot
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ ${onc0} Make ONC with path output/09

1. Get list by location, 1 page
${result}= Run method getListByLocation with filters &{F_LOCATION1}
List ${result}[files] has exactly 15 rows
List ${result}[files] has at least 13 rows

2. Get list by location, 3 pages
${result}= Run method getListByLocation with &{F_LOCATION1} and parameter ${True}
List ${result}[files] has exactly 15 rows
List ${result}[files] has at least 13 rows

3. Get list by location, 1 page, filter by extension
${result}= Run method getListByLocation with filters &{F_LOCATIONFULL}
Expand Down Expand Up @@ -69,7 +69,7 @@ ${onc0} Make ONC with path output/09

12. Get list by location, 3 pages, return archiveLocations
${result}= Run method getListByLocation with &{F_LOC_RETURN1} and parameter ${True}
List ${result}[files] has exactly 15 rows
List ${result}[files] has at least 13 rows
First row in ${result}[files] has key "archiveLocation"

13. Get list by device, 3 pages, filter extension, return all metadata per sample
Expand Down

0 comments on commit 658bb92

Please sign in to comment.