-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_example.py
44 lines (29 loc) · 878 Bytes
/
test_example.py
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
import pytest
import src.algorithms.example
class TestExample:
@pytest.fixture
def minimum(self) -> int:
"""
:return: The expected minimum value
"""
return 1
@pytest.fixture
def maximum(self) -> int:
"""
:return: The expected upper boundary value
"""
return 16
@pytest.fixture
def instances(self) -> int:
"""
:return: The expected number of instances
"""
return 200000
@staticmethod
def test_exc(minimum: int, maximum: int, instances: int):
example = src.algorithms.example.Example()
data = example.exc()
print(data)
assert data['value'].min() >= minimum, 'Minima error'
assert data['value'].max() < maximum, 'Maxima error'
assert data['frequency'].sum() == instances, 'Instances error'