16 lines
440 B
Python
16 lines
440 B
Python
import io
|
|
|
|
import pytest
|
|
|
|
from wcs.blocks import BlockDef, BlockdefImportError
|
|
|
|
|
|
def test_import_root_node_error():
|
|
export = b'<wrong_root_node><name>Name</name></wrong_root_node>'
|
|
with pytest.raises(BlockdefImportError) as excinfo:
|
|
BlockDef.import_from_xml(io.BytesIO(export))
|
|
assert (
|
|
excinfo.value.msg
|
|
== 'Provided XML file is invalid, it starts with a <wrong_root_node> tag instead of <block>'
|
|
)
|