def test_parse_mappings_astxt(): # fd = StringIO(txtloc) with open(txtfile) as fd: data = location.parse_mappings_astxt(fd) assert isinstance(data, dict) assert len(data) == 2 assert data.get("uri:nist.gov/goober") == "http://www.ivoa.net/xml/goober" assert data.get("http://mgi.nist.gov/goof") == "goof.xml"
def test_parse_mappings_astxt(): # fd = StringIO(txtloc) with open(txtfile) as fd: data = location.parse_mappings_astxt(fd) assert isinstance(data, dict) assert len(data) == 2 assert data.get( "uri:nist.gov/goober") == "http://www.ivoa.net/xml/goober" assert data.get("http://mgi.nist.gov/goof") == "goof.xml"
def test_bad_parse_mappings_astxt(): with open(jsonfile) as fd: with pytest.raises(ValueError): data = location.parse_mappings_astxt(fd)