summaryrefslogtreecommitdiff
path: root/tests/test_constants.py
diff options
context:
space:
mode:
authorBen Connors <benconnors@outlook.com>2019-09-27 14:57:46 -0400
committerBen Connors <benconnors@outlook.com>2019-09-27 14:57:46 -0400
commit0fc3371d48d7e87a5628b16c2bbd09c3fb15cd8e (patch)
tree64dd6994f04a08b269dcf14ff5c26b2d2b542db5 /tests/test_constants.py
parentdfe20c0430c7d58b57c44026102cf8b3c52ac1b3 (diff)
Bugfixes
- Add some new tests - Run some basic (interactive) chaser tests, they work-ish now
Diffstat (limited to 'tests/test_constants.py')
-rw-r--r--tests/test_constants.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_constants.py b/tests/test_constants.py
new file mode 100644
index 0000000..5ce0b1a
--- /dev/null
+++ b/tests/test_constants.py
@@ -0,0 +1,20 @@
+"""Tests for the constants used.
+
+Mainly just tests the INFTY object.
+"""
+
+import pytest
+
+from blc2.constants import INFTY, _Infinity
+
+def test_infty():
+ assert str(INFTY) == "infty"
+ assert 1+INFTY == INFTY+1 == INFTY
+ assert 1-INFTY == INFTY-1 == INFTY
+ assert 4*INFTY == INFTY*4 == INFTY*0.4 == INFTY
+
+ with pytest.raises(Exception):
+ _ = INFTY * 0
+
+ with pytest.raises(Exception):
+ infty2 = _Infinity()