Skip to content

Commit

Permalink
Fix more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha committed Nov 20, 2024
1 parent e519337 commit a405a7c
Showing 1 changed file with 41 additions and 11 deletions.
52 changes: 41 additions & 11 deletions tests/parsers/test_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ def test_pp_default_1d(
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'

node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_1d', generate_inputs_1d)
attributes = {'keep_data_files': False, 'parse_data_files': True}

node = generate_calc_job_node(
entry_point_calc_job, fixture_localhost, 'default_1d', generate_inputs_1d, attributes=attributes
)
parser = generate_parser(entry_point_parser)
results, calcfunction = parser.parse_from_node(node, store_provenance=False)

Expand Down Expand Up @@ -157,9 +161,13 @@ def test_pp_default_1d_spherical(
"""Test a default `pp.x` calculation producing a 1D data set with spherical averaging."""
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'

attributes = {'keep_data_files': False, 'parse_data_files': True}
node = generate_calc_job_node(
entry_point_calc_job, fixture_localhost, 'default_1d_spherical', generate_inputs_1d_spherical
entry_point_calc_job,
fixture_localhost,
'default_1d_spherical',
generate_inputs_1d_spherical,
attributes=attributes
)
parser = generate_parser(entry_point_parser)
results, calcfunction = parser.parse_from_node(node, store_provenance=False)
Expand Down Expand Up @@ -200,8 +208,11 @@ def test_pp_default_2d(
"""Test a default `pp.x` calculation producing a 2D data set."""
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'
attributes = {'keep_data_files': False, 'parse_data_files': True}

node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_2d', generate_inputs_2d)
node = generate_calc_job_node(
entry_point_calc_job, fixture_localhost, 'default_2d', generate_inputs_2d, attributes=attributes
)
parser = generate_parser(entry_point_parser)
results, calcfunction = parser.parse_from_node(node, store_provenance=False)

Expand Down Expand Up @@ -237,8 +248,11 @@ def test_pp_default_polar(
"""Test a default `pp.x` calculation producing a polar coordinates data set."""
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'
attributes = {'keep_data_files': False, 'parse_data_files': True}

node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_polar', generate_inputs_polar)
node = generate_calc_job_node(
entry_point_calc_job, fixture_localhost, 'default_polar', generate_inputs_polar, attributes=attributes
)
parser = generate_parser(entry_point_parser)
results, calcfunction = parser.parse_from_node(node, store_provenance=False)

Expand Down Expand Up @@ -267,8 +281,11 @@ def test_pp_default_3d(
"""Test a default `pp.x` calculation producing a 3D data set."""
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'
attributes = {'keep_data_files': False, 'parse_data_files': True}

node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_3d', generate_inputs_3d)
node = generate_calc_job_node(
entry_point_calc_job, fixture_localhost, 'default_3d', generate_inputs_3d, attributes=attributes
)
parser = generate_parser(entry_point_parser)
results, calcfunction = parser.parse_from_node(node, store_provenance=False)

Expand Down Expand Up @@ -302,7 +319,11 @@ def test_pp_default_3d_keep_data_files(generate_calc_job_node, generate_parser,
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'

attributes = {'options': {'keep_data_files': False}, 'retrieve_temporary_list': ['aiida.fileout']}
attributes = {
'keep_data_files': False,
'parse_data_files': True,
'retrieve_temporary_list': ['aiida.fileout'],
}
node = generate_calc_job_node(
entry_point_calc_job,
test_name='default_3d',
Expand All @@ -325,7 +346,7 @@ def test_pp_default_3d_parse_data_files(generate_calc_job_node, generate_parser,
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'

attributes = {'parse_data_files': False}
attributes = {'keep_data_files': False, 'parse_data_files': False}
node = generate_calc_job_node(
entry_point_calc_job,
test_name='default_3d',
Expand All @@ -345,8 +366,11 @@ def test_pp_default_3d_multiple(generate_calc_job_node, generate_parser, generat
"""Test a default `pp.x` calculation producing multiple files in 3D format."""
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'
attributes = {'keep_data_files': False, 'parse_data_files': True}

node = generate_calc_job_node(entry_point_calc_job, test_name='default_3d_multiple', inputs=generate_inputs_3d)
node = generate_calc_job_node(
entry_point_calc_job, test_name='default_3d_multiple', inputs=generate_inputs_3d, attributes=attributes
)
parser = generate_parser(entry_point_parser)
results, calcfunction = parser.parse_from_node(node, store_provenance=False)

Expand Down Expand Up @@ -385,9 +409,14 @@ def test_pp_default_3d_failed_missing_data(
"""Test a default `pp.x` calculation where the aiida.fileout file is missing."""
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'
attributes = {'keep_data_files': False, 'parse_data_files': True}

node = generate_calc_job_node(
entry_point_calc_job, fixture_localhost, 'default_3d_failed_missing_data', generate_inputs_3d
entry_point_calc_job,
fixture_localhost,
'default_3d_failed_missing_data',
generate_inputs_3d,
attributes=attributes
)
parser = generate_parser(entry_point_parser)
_, calcfunction = parser.parse_from_node(node, store_provenance=False)
Expand Down Expand Up @@ -419,9 +448,10 @@ def test_pp_default_3d_failed_format(fixture_localhost, generate_calc_job_node,
"""Test a default `pp.x` calculation where an unsupported output file format is used."""
entry_point_calc_job = 'quantumespresso.pp'
entry_point_parser = 'quantumespresso.pp'
attributes = {'keep_data_files': False, 'parse_data_files': True}

node = generate_calc_job_node(
entry_point_calc_job, fixture_localhost, 'default_3d_failed_format', generate_inputs_3d
entry_point_calc_job, fixture_localhost, 'default_3d_failed_format', generate_inputs_3d, attributes=attributes
)
parser = generate_parser(entry_point_parser)
_, calcfunction = parser.parse_from_node(node, store_provenance=False)
Expand Down

0 comments on commit a405a7c

Please sign in to comment.