Skip to content

Commit

Permalink
fix pattern tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rabernat committed Jan 12, 2022
1 parent 141ef3b commit ff7cab3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_pattern_from_file_sequence():
assert fp.nitems_per_input == {"time": None}
assert fp.concat_sequence_lens == {"time": None}
for key in fp:
assert fp[key] == file_sequence[key[0].index]
assert fp[key] == file_sequence[sorted(key)[0].index]


@pytest.mark.parametrize("pickle", [False, True])
Expand Down Expand Up @@ -115,17 +115,17 @@ def test_file_pattern_concat_merge(runtime_secrets, pickle, concat_merge_pattern
assert fp.concat_sequence_lens == {"time": None}
assert len(list(fp)) == 6
for key in fp:
expected_fname = format_function(time=times[key[1].index], variable=varnames[key[0].index])
for k in key:
if k.name == "time":
assert k.operation == CombineOp.CONCAT
assert k.sequence_len == 3
time_val = times[k.index]
if k.name == "variable":
assert k.operation == CombineOp.MERGE
assert k.sequence_len == 2
variable_val = varnames[k.index]
expected_fname = format_function(time=time_val, variable=variable_val)
assert fp[key] == expected_fname
# make sure key order doesn't matter
assert fp[key[::-1]] == expected_fname

if "fsspec_open_kwargs" in kwargs.keys():
assert fp.is_opendap is False
Expand Down

0 comments on commit ff7cab3

Please sign in to comment.