def test_convert_single_g2m_not_a_loc(): with pytest.raises(AttributeError): convert.loc_geo_to_mag([20, 30], "2012-06-15 22:02")
def test_convert_geo_to_mag_loc(): time = datetime(year=2012, month=6, day=15, hour=22, minute=2) newloc = convert.loc_geo_to_mag(north_pole, time) assert newloc.lat == NP_MLAT assert newloc.lon == NP_MLON
def test_convert_single_g2m_strdate_timezone(): time = "2012-06-15 22:02Z" res = convert.loc_geo_to_mag(north_pole, time) assert res.lat == NP_MLAT assert res.lon == NP_MLON
def test_convert_single_g2m_unknown_date(): time = "This can't be a time" with pytest.raises(ValueError): convert.loc_geo_to_mag(north_pole, time)
def test_convert_single_g2m_not_a_datetime(): time = "2012-06-15 22:02" res = convert.loc_geo_to_mag(north_pole, time) assert res.lat == NP_MLAT assert res.lon == NP_MLON