-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy pathtest__extremes.py
More file actions
56 lines (40 loc) · 1.3 KB
/
test__extremes.py
File metadata and controls
56 lines (40 loc) · 1.3 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
"""Test Extremes."""
# standard
from typing import Any
# external
import pytest
# local
from validators._extremes import AbsMax, AbsMin
abs_max = AbsMax()
abs_min = AbsMin()
@pytest.mark.parametrize(
("value",),
[(None,), ("",), (12,), (abs_min,)],
)
def test_abs_max_is_greater_than_every_other_value(value: Any):
"""Test if AbsMax is greater than every other value."""
assert value < abs_max
assert abs_max > value
def test_abs_max_is_not_greater_than_itself():
"""Test if AbsMax is not greater than itself."""
assert not (abs_max > abs_max)
def test_other_comparison_methods_for_abs_max():
"""Test other comparison methods for AbsMax."""
assert abs_max <= abs_max
assert abs_max == abs_max
assert abs_max == abs_max
@pytest.mark.parametrize(
("value",),
[(None,), ("",), (12,), (abs_max,)],
)
def test_abs_min_is_smaller_than_every_other_value(value: Any):
"""Test if AbsMin is less than every other value."""
assert value > abs_min
def test_abs_min_is_not_greater_than_itself():
"""Test if AbsMin is not less than itself."""
assert not (abs_min < abs_min)
def test_other_comparison_methods_for_abs_min():
"""Test other comparison methods for AbsMin."""
assert abs_min <= abs_min
assert abs_min == abs_min
assert abs_min == abs_min