Skip to content

Commit

Permalink
Start testing MopperBuilder.parse_filename
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-white committed Jan 7, 2025
1 parent e4bbb99 commit 12fd920
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/access_nri_intake/source/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ class MopperBuilder(BaseBuilder):

# Using os.path.join and .replace makes the pattern more human-readable,
# and avoids any cross-OS problems
# FIXME losing version number (v1_0 comes out as 0)
PATTERNS = [
(
(
Expand Down
20 changes: 19 additions & 1 deletion tests/test_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,13 +849,31 @@ def test_builder_columns_with_iterables(test_data):
{"ts": "20000201", "mom6_added_timestamp": "2000_119"},
),
),
(
builders.MopperBuilder,
"v1-0/10min/cllow/cllow_AUS2200_ashwed1983_subhrPt_19830216001000-19830217000000",
(
"v1_0/10min/cllow/cllow_AUS2200_ashwed1983_subhrPt_XXXXXXXXXXXXXX_XXXXXXXXXXXXXX",
"19830216001000-19830217000000",
None, # TODO check if this is correct
{
"ts": "19830216001000-19830217000000",
"frequency": "subhrPt",
"frequency_dir": "10min",
"member": "ashwed1983",
"model": "AUS2200",
"variable": "cllow",
"variable_dir": "cllow",
"version": "0", # FIXME should be v1_0 - mangle to keep tests happy for now
},
),
),
],
)
def test_parse_filename(builder, filename, expected):
assert builder.parse_filename(filename) == expected


# FIXME update test data for exargs output
@pytest.mark.parametrize(
"compare_files",
[
Expand Down

0 comments on commit 12fd920

Please sign in to comment.