예제 #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]
예제 #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]
예제 #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)
예제 #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)