| blc2 - Python library and frontend for running theatrical lighting and SFX. Written for the English 2041F fall 2019 theatre production of "The Cenci".
git clone https://benconnors.ca/git-repos/blc2 |
test_constants.py (441B) - raw
1 """Tests for the constants used. 2 3 Mainly just tests the INFTY object. 4 """ 5 6 import pytest 7 8 from blc2.constants import INFTY, _Infinity 9 10 def test_infty(): 11 assert str(INFTY) == "infty" 12 assert 1+INFTY == INFTY+1 == INFTY 13 assert 1-INFTY == INFTY-1 == INFTY 14 assert 4*INFTY == INFTY*4 == INFTY*0.4 == INFTY 15 16 with pytest.raises(Exception): 17 _ = INFTY * 0 18 19 with pytest.raises(Exception): 20 infty2 = _Infinity()