예제 #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"
예제 #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"
예제 #3
0
def test_bad_parse_mappings_astxt():
    with open(jsonfile) as fd:
        with pytest.raises(ValueError):
            data = location.parse_mappings_astxt(fd)
예제 #4
0
def test_bad_parse_mappings_astxt():
    with open(jsonfile) as fd:
        with pytest.raises(ValueError):
            data = location.parse_mappings_astxt(fd)