Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-FAIR
Commits
5a81538a
Commit
5a81538a
authored
5 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed strict xml parsing in vasp parser.
parent
b4c1f570
No related branches found
No related tags found
1 merge request
!69
V0.6.4
Pipeline
#63202
passed
5 years ago
Stage: build
Stage: test
Stage: release
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dependencies/parsers/vasp
+1
-1
1 addition, 1 deletion
dependencies/parsers/vasp
tests/data/parsers/vasp/broken.xml
+2150
-0
2150 additions, 0 deletions
tests/data/parsers/vasp/broken.xml
tests/test_parsing.py
+15
-3
15 additions, 3 deletions
tests/test_parsing.py
with
2166 additions
and
4 deletions
vasp
@
d9c9b3c1
Compare
01427529
...
d9c9b3c1
Subproject commit
01427529696c8dc6cb6e8393875704f2983a768d
Subproject commit
d9c9b3c14ecab80e58adab70917267e5e7fbe3f2
This diff is collapsed.
Click to expand it.
tests/data/parsers/vasp/broken.xml
0 → 100644
+
2150
−
0
View file @
5a81538a
This diff is collapsed.
Click to expand it.
tests/test_parsing.py
+
15
−
3
View file @
5a81538a
...
...
@@ -74,7 +74,7 @@ for parser, mainfile in parser_examples:
parser_examples
=
fixed_parser_examples
correct_num_output_files
=
4
3
correct_num_output_files
=
4
4
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment