def test_to_grib_step(): message = {} step_ns = 60 * 60 * 1e9 cfmessage.to_grib_step(message, step_ns, step_unit=1) assert message["endStep"] == 1 assert message["stepUnits"] == 1 with pytest.raises(ValueError): cfmessage.to_grib_step(message, 0, step_unit=3)
def test_to_grib_step(): message = {} # type: T.Dict[str, T.Any] step_ns = 3600 * 1_000_000_000 cfmessage.to_grib_step(message, step_ns, step_unit=1) assert message["endStep"] == 1 assert message["stepUnits"] == 1 with pytest.raises(ValueError): cfmessage.to_grib_step(message, 0, step_unit=3)