예제 #1
0
 def test_pump_laws_non_int(self):
     p = CentrifPump("", 100, 12, 45, 300)
     with pytest.raises(TypeError) as excinfo:
         p.speed = "a"
     exception_msg = excinfo.value.args[0]
     assert exception_msg == "Numeric values only."
예제 #2
0
 def test_pump_laws_neg(self):
     p = CentrifPump("", 100, 12, 45, 300)
     with pytest.raises(ValueError) as excinfo:
         p.speed = -120
     exception_msg = excinfo.value.args[0]
     assert exception_msg == "Speed must be 0 or greater."