summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-09-08 00:19:21 +0200
committerAki <please@ignore.pl>2022-09-08 00:19:21 +0200
commit69ae90ca12795108caf6ed93dacfadd75bcb3208 (patch)
treeaa7023338767b9cbc112ebb2acc05f7fab7d41d6
parenta09b2bbf82b74e155b99eae3aaa10acfd4269c92 (diff)
downloadszilagyi-69ae90ca12795108caf6ed93dacfadd75bcb3208.zip
szilagyi-69ae90ca12795108caf6ed93dacfadd75bcb3208.tar.gz
szilagyi-69ae90ca12795108caf6ed93dacfadd75bcb3208.tar.bz2
Extended testing samples
-rw-r--r--szilagyi/tests.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/szilagyi/tests.py b/szilagyi/tests.py
index 87b4dd4..bf59873 100644
--- a/szilagyi/tests.py
+++ b/szilagyi/tests.py
@@ -5,12 +5,27 @@ from . import calculate_swi
class CalculateSwi(unittest.TestCase):
def test_out_of_range(self):
- for dt, depth in [(20, -10), (-10, 25000), (20, 6e+4), (41, 25000), (41, -10)]:
+ samples = [
+ (20, -10),
+ (-10, 25000),
+ (20, 60000),
+ (41, 25000),
+ (41, -10),
+ ]
+ for dt, depth in samples:
with self.assertRaises(ValueError):
calculate_swi(dt, depth)
def test_between(self):
- for dt, depth, low, high in [(6.53, 3e+4, 1, 2)]:
+ samples = [
+ (6.53, 30000, 1, 2),
+ (10.78, 20500, -1, 0),
+ (24.45, 2600, 0, 1),
+ (7.22, 1300, -10, -9),
+ (16.1, 6200, 0, 1),
+ (3, 20000, -4, -3),
+ ]
+ for dt, depth, low, high in samples:
swi = calculate_swi(dt, depth)
self.assertGreater(swi, low)
self.assertLess(swi, high)