Commit 5a81538a authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed strict xml parsing in vasp parser.

parent b4c1f570
Pipeline #63202 passed with stages
in 27 minutes and 33 seconds
Subproject commit 01427529696c8dc6cb6e8393875704f2983a768d
Subproject commit d9c9b3c14ecab80e58adab70917267e5e7fbe3f2
This diff is collapsed.
......@@ -74,7 +74,7 @@ for parser, mainfile in parser_examples:
parser_examples = fixed_parser_examples
correct_num_output_files = 43
correct_num_output_files = 44
class TestLocalBackend(object):
......@@ -259,10 +259,13 @@ def test_stream_generator(pretty, no_warn):
assert create_reference(example_data, pretty) == out.getvalue()
def assert_parser_result(backend):
def assert_parser_result(backend, error=False):
status, errors = backend.status
assert status == 'ParseSuccess'
assert errors is None or len(errors) == 0
if error:
assert len(errors) > 0
else:
assert errors is None or len(errors) == 0
def assert_parser_dir_unchanged(previous_wd, current_wd):
......@@ -321,6 +324,15 @@ def test_parser(parser_name, mainfile):
assert_parser_dir_unchanged(previous_wd, current_wd=os.getcwd())
def test_broken_xml_vasp():
parser_name, mainfile = 'parsers/vasp', 'tests/data/parsers/vasp/broken.xml'
previous_wd = os.getcwd() # Get Working directory before parsing.
parsed_example = run_parser(parser_name, mainfile)
assert_parser_result(parsed_example, error=True)
# Check that cwd has not changed.
assert_parser_dir_unchanged(previous_wd, current_wd=os.getcwd())
def test_match(raw_files, no_warn):
example_upload_id = 'example_upload_id'
upload_files = files.StagingUploadFiles(example_upload_id, create=True, is_authorized=lambda: True)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment