def test_from_invalid_power_raises_error(self): power = 10 with pytest.raises(InvalidPower) as error: Unit.from_power(power) assert error.match("Valid powers are")
def test_from_1_returns_kilo(self): power = 1 actual = Unit.from_power(power) expected = Unit.KILO assert actual == expected