Skip to content

Commit dc37595

Browse files
authored
BUG: fixing repoint check logic to return as bool (#270)
1 parent 9bea275 commit dc37595

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

imap_data_access/file_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def is_valid_repointing(input_repointing: str) -> bool:
414414
bool
415415
Whether input repointing is valid or not.
416416
"""
417-
return re.fullmatch(r"repoint\d{5}", str(input_repointing))
417+
return bool(re.fullmatch(r"repoint\d{5}", str(input_repointing)))
418418

419419
def is_valid_for_start_date(self, start_date: datetime) -> bool:
420420
"""Check if the file is valid for the given science file start_date.

tests/test_file_validation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,3 +678,8 @@ def test_dependency_file_path():
678678
file = DependencyFilePath("imap_mag_l1a_test_20210101_v001.json")
679679
assert file.instrument == "mag"
680680
assert file.start_date == "20210101"
681+
682+
683+
def test_repoint():
684+
state = imap_data_access.ScienceFilePath.is_valid_repointing("repoint00001")
685+
assert state is True

0 commit comments

Comments
 (0)