Beispiel #1
0
def test_xml_to_dict_invalid(invalid_xml):
    with pytest.raises(utils.MediaTypeError) as e:
        with open(invalid_xml, "r", encoding="UTF-8") as f:
            data = f.read()
            utils._xml_to_dict(data)

    msg = "Error parsing XML: "
    assert msg in e.value.args[0]
Beispiel #2
0
def test_xml_to_dict_invalid(invalid_xml):
    with pytest.raises(utils.MediaTypeError) as e:
        with open(invalid_xml, "r", encoding="UTF-8") as f:
            data = f.read()
            utils._xml_to_dict(data)

    msg = "Error parsing XML: "
    assert msg in e.value.args[0]
Beispiel #3
0
def test_xml_to_dict(downloaded_xml):
    with open(downloaded_xml, "r", encoding="UTF-8") as f:
        data = f.read()
        xml_data = utils._xml_to_dict(data)
        assert xml_data is not None
        assert isinstance(xml_data, dict)
Beispiel #4
0
def test_xml_to_dict(downloaded_xml):
    with open(downloaded_xml, "r", encoding="UTF-8") as f:
        data = f.read()
        xml_data = utils._xml_to_dict(data)
        assert xml_data is not None
        assert isinstance(xml_data, dict)