-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scicat backend test unit test helper.
- Loading branch information
1 parent
4da7d7f
commit da183bf
Showing
9 changed files
with
101 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
# Do not make an environment from this file, use test.txt instead! | ||
|
||
pytest | ||
scitacean |
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 |
---|---|---|
@@ -1,15 +1,56 @@ | ||
# SHA1:0eaa389e1fdb3a1917c0f987514bd561be5718ee | ||
# SHA1:e820b087b52d0475bec279a238bcec7a1730ea9d | ||
# | ||
# This file is autogenerated by pip-compile-multi | ||
# To update, run: | ||
# | ||
# pip-compile-multi | ||
# | ||
annotated-types==0.7.0 | ||
# via pydantic | ||
anyio==4.4.0 | ||
# via httpx | ||
certifi==2024.7.4 | ||
# via | ||
# httpcore | ||
# httpx | ||
dnspython==2.6.1 | ||
# via email-validator | ||
email-validator==2.2.0 | ||
# via scitacean | ||
h11==0.14.0 | ||
# via httpcore | ||
httpcore==1.0.5 | ||
# via httpx | ||
httpx==0.27.0 | ||
# via scitacean | ||
idna==3.7 | ||
# via | ||
# anyio | ||
# email-validator | ||
# httpx | ||
iniconfig==2.0.0 | ||
# via pytest | ||
packaging==24.1 | ||
# via pytest | ||
pluggy==1.5.0 | ||
# via pytest | ||
pydantic==2.8.2 | ||
# via scitacean | ||
pydantic-core==2.20.1 | ||
# via pydantic | ||
pytest==8.3.2 | ||
# via -r basetest.in | ||
python-dateutil==2.9.0.post0 | ||
# via scitacean | ||
scitacean==24.5.0 | ||
# via -r basetest.in | ||
six==1.16.0 | ||
# via python-dateutil | ||
sniffio==1.3.1 | ||
# via | ||
# anyio | ||
# httpx | ||
typing-extensions==4.12.2 | ||
# via | ||
# pydantic | ||
# pydantic-core |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,3 @@ mypy==1.11.1 | |
# via -r mypy.in | ||
mypy-extensions==1.0.0 | ||
# via mypy | ||
typing-extensions==4.12.2 | ||
# via mypy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import pytest | ||
from scitacean.testing.backend import add_pytest_option as add_backend_option | ||
|
||
pytest_plugins = ("scitacean.testing.backend.fixtures",) | ||
|
||
|
||
def pytest_addoption(parser: pytest.Parser) -> None: | ||
add_backend_option(parser) |
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,40 @@ | ||
import logging | ||
|
||
from scicat_communication import create_scicat_dataset | ||
from scicat_configuration import SciCatOptions | ||
from scicat_dataset import ScicatDataset, scicat_dataset_to_dict | ||
|
||
SAMPLE_OPTION = SciCatOptions( | ||
host="localhost", | ||
token="", | ||
headers={}, | ||
timeout=1, | ||
stream=False, | ||
verify=False, | ||
) | ||
|
||
|
||
def test_create_scicat_dataset(require_scicat_backend: bool): | ||
assert require_scicat_backend | ||
dummy_dataset = ScicatDataset( | ||
pid='abc', | ||
size=0, | ||
numberOfFiles=0, | ||
isPublished=False, | ||
datasetName='datasetName', | ||
description='description', | ||
principalInvestigator='principalInvestigator', | ||
creationLocation="here", | ||
scientificMetadata={}, | ||
owner="me", | ||
ownerEmail="", | ||
sourceFolder="", | ||
contactEmail="", | ||
creationTime="now", | ||
sampleId="", | ||
) | ||
create_scicat_dataset( | ||
dataset=scicat_dataset_to_dict(dummy_dataset), | ||
config=SAMPLE_OPTION, | ||
logger=logging.getLogger(__name__), | ||
) |