Skip to content

Commit 5049cf2

Browse files
committed
Added a test for MavericK normalization.
1 parent 579b15f commit 5049cf2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/maverick_functions_tests.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,21 @@ def _hash_function(dir_to_test):
124124
generated_hashes = _hash_function("files/merged")
125125

126126
assert known_hashes == generated_hashes
127+
128+
129+
def test_maverick_normalization():
130+
"""
131+
Test weather the maverick normalization is working.
132+
This is a fuzzy test, since its result is allways different due to using
133+
random numbers.
134+
We cannot test the result, but we can test if the function works and returns
135+
what it was supposed to (in this case, a dict).
136+
"""
137+
x_mean = [-312.847354, -301.40566]
138+
x_sd = [0.0, 0.004978]
139+
k_list = range(1, 3)
140+
141+
real_result = list(mw.maverick_normalization(x_mean, x_sd, k_list,
142+
draws=int(1e5)).keys())
143+
144+
assert real_result == list(k_list)

0 commit comments

Comments
 (0)