3
3
4
4
import pytest
5
5
6
- from access .parsers .payu_config_yaml import YAMLParser
6
+ from access .parsers .yaml_config import YAMLParser
7
7
8
8
9
9
@pytest .fixture (scope = "module" )
@@ -13,7 +13,7 @@ def parser():
13
13
14
14
15
15
@pytest .fixture ()
16
- def simple_payu_config ():
16
+ def simple_yaml_config ():
17
17
"""Fixture returning a dictionary storing a payu config file."""
18
18
return {
19
19
"project" : "x77" ,
@@ -33,7 +33,7 @@ def simple_payu_config():
33
33
34
34
35
35
@pytest .fixture ()
36
- def simple_payu_config_file ():
36
+ def simple_yaml_config_file ():
37
37
"""Fixture returning the contents of a simple payu config file."""
38
38
return """project: x77
39
39
ncpus: 48
@@ -51,7 +51,7 @@ def simple_payu_config_file():
51
51
52
52
53
53
@pytest .fixture ()
54
- def payu_config_file ():
54
+ def yaml_config_file ():
55
55
"""Fixture returning the contents of a more complex payu config file."""
56
56
return """# PBS configuration
57
57
@@ -81,7 +81,7 @@ def payu_config_file():
81
81
82
82
83
83
@pytest .fixture ()
84
- def modified_payu_config_file ():
84
+ def modified_yaml_config_file ():
85
85
"""Fixture returning the contents the previous payu config file after introducing some modifications."""
86
86
return """# PBS configuration
87
87
@@ -109,19 +109,19 @@ def modified_payu_config_file():
109
109
"""
110
110
111
111
112
- def test_read_payu_config (parser , simple_payu_config , simple_payu_config_file ):
112
+ def test_read_yaml_config (parser , simple_yaml_config , simple_yaml_config_file ):
113
113
"""Test parsing of a simple file."""
114
- config = parser .parse (simple_payu_config_file )
114
+ config = parser .parse (simple_yaml_config_file )
115
115
116
- assert config == simple_payu_config
116
+ assert config == simple_yaml_config
117
117
118
118
119
- def test_round_trip_payu_config (parser , payu_config_file , modified_payu_config_file ):
119
+ def test_round_trip_yaml_config (parser , yaml_config_file , modified_yaml_config_file ):
120
120
"""Test round-trip parsing of a more complex file with mutation of the config."""
121
- config = parser .parse (payu_config_file )
121
+ config = parser .parse (yaml_config_file )
122
122
123
123
config ["ncpus" ] = 64
124
124
config ["input" ][0 ] = "/some/other/path/to/inputs/1deg/mom"
125
125
del config ["exe" ]
126
126
127
- assert modified_payu_config_file == str (config )
127
+ assert modified_yaml_config_file == str (config )
0 commit comments