-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_fetch.py
More file actions
75 lines (66 loc) · 2.06 KB
/
test_fetch.py
File metadata and controls
75 lines (66 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import pytest
from simvue.api.objects import Alert, Artifact, Tag, Run
@pytest.mark.api
@pytest.mark.online
@pytest.mark.parametrize(
"sort_column,sort_descending",
[
("name", True),
("created", False),
(None, None)
],
ids=("name-desc", "created-asc", "no-sorting")
)
def test_alerts_fetch(sort_column: str | None, sort_descending: bool | None) -> None:
if sort_column:
assert dict(Alert.get(sorting=[{"column": sort_column, "descending": sort_descending}], count=10))
else:
assert dict(Alert.get(count=10))
@pytest.mark.api
@pytest.mark.online
@pytest.mark.parametrize(
"sort_column,sort_descending",
[
("name", True),
("created", False),
(None, None)
],
ids=("name-desc", "created-asc", "no-sorting")
)
def test_artifacts_fetch(create_test_run, sort_column: str | None, sort_descending: bool | None) -> None:
if sort_column:
assert dict(Artifact.get(sorting=[{"column": sort_column, "descending": sort_descending}], count=10))
else:
assert dict(Artifact.get(count=10))
@pytest.mark.api
@pytest.mark.online
@pytest.mark.parametrize(
"sort_column,sort_descending",
[
("name", True),
("created", False),
(None, None)
],
ids=("name-desc", "created-asc", "no-sorting")
)
def test_tags_fetch(create_test_run, sort_column: str | None, sort_descending: bool | None) -> None:
if sort_column:
assert dict(Tag.get(sorting=[{"column": sort_column, "descending": sort_descending}], count=10))
else:
assert dict(Tag.get(count=10))
@pytest.mark.api
@pytest.mark.online
@pytest.mark.parametrize(
"sort_column,sort_descending",
[
("name", True),
("name", False),
(None, None)
],
ids=("name-desc", "created-asc", "no-sorting")
)
def test_runs_fetch(sort_column: str | None, sort_descending: bool | None) -> None:
if sort_column:
assert dict(Run.get(sorting=[{"column": sort_column, "descending": sort_descending}], count=10))
else:
assert dict(Run.get(count=10))