コード例 #1
0
 def test_hli_indicator_threshold_negative_number(self):
     """Test for invalid negative value for threshold."""
     with pytest.raises(ValueError):
         hli_indicator(98, threshold=-1)
コード例 #2
0
 def test_hli_indicator_threshold_non_numeric(self):
     """Test for invalid non-numeric value for hli."""
     with pytest.raises(ValueError):
         hli_indicator(98, threshold='invalid_number')
コード例 #3
0
 def test_hli_indicator_hli_negative_number(self):
     """Test for invalid negative value for hli."""
     with pytest.raises(ValueError):
         hli_indicator(-1)
コード例 #4
0
 def test_hli_indicator_extreme_risk(self):
     """Test heat load index indicator is extreme risk."""
     expected = Indicator.EXTREME.value
     indicator = hli_indicator(300)
     assert indicator == expected
コード例 #5
0
 def test_hli_indicator_high_risk(self):
     """Test heat load index indicator is high risk."""
     expected = Indicator.HIGH.value
     indicator = hli_indicator(97)
     assert indicator == expected
コード例 #6
0
 def test_hli_indicator_medium_risk(self):
     """Test heat load index indicator is medium risk."""
     expected = Indicator.MEDIUM.value
     indicator = hli_indicator(22)
     assert indicator == expected
コード例 #7
0
 def test_hli_indicator_low_risk(self):
     """Test heat load index indicator is low risk."""
     expected = Indicator.LOW.value
     indicator = hli_indicator(19)
     assert indicator == expected
コード例 #8
0
 def test_hli_indicator_neglegible(self):
     """Test heat load index indicator is neglegible."""
     expected = Indicator.NEGLEGIBLE.value
     indicator = hli_indicator(0)
     assert indicator == expected