From 0fc3371d48d7e87a5628b16c2bbd09c3fb15cd8e Mon Sep 17 00:00:00 2001 From: Ben Connors Date: Fri, 27 Sep 2019 14:57:46 -0400 Subject: Bugfixes - Add some new tests - Run some basic (interactive) chaser tests, they work-ish now --- tests/test_constants.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/test_constants.py (limited to 'tests/test_constants.py') 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() -- cgit v1.2.3