def test_omm_xml_matches_old_tle(): line0, line1, line2 = VANGUARD_TLE.splitlines() sat1 = Satrec.twoline2rv(line1, line2) fields = next(omm.parse_xml(StringIO(VANGUARD_XML))) sat2 = Satrec() omm.initialize(sat2, fields) assert_satellites_match(sat1, sat2)
def _make_query(url): response = httpx.get(url) response.raise_for_status() if response.text == "No GP data found": raise ValueError( f"Query '{url}' did not return any results, try a different one") tree = ET.parse(io.StringIO(response.text)) root = tree.getroot() if len(root) != 1: raise ValueError( f"Query '{url}' returned {len(root)} results, try a different one") fields = next(omm.parse_xml(io.StringIO(response.text))) return fields