Ejemplo n.º 1
0
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"
Ejemplo n.º 2
0
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"
Ejemplo n.º 3
0
def test_bad_parse_mappings_astxt():
    with open(jsonfile) as fd:
        with pytest.raises(ValueError):
            data = location.parse_mappings_astxt(fd)
Ejemplo n.º 4
0
def test_bad_parse_mappings_astxt():
    with open(jsonfile) as fd:
        with pytest.raises(ValueError):
            data = location.parse_mappings_astxt(fd)