Skip to content

Commit

Permalink
Fixed regex formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsUnagii committed Dec 7, 2024
1 parent 1d86f2a commit 28d2919
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions scripts/tests/test_field_record_pics.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ def get_all_deployment_dates(csv_file_fixture: TextIOWrapper):

for deployment_date_reformatted in deployment_dates_reformatted:
found = False
regex_pattern = fr"deploy-{deployment_date_reformatted}-audiomoth-(\w+)\.(jpg|jpeg|JPG|JPEG)"
regex_pattern = rf"deploy-{deployment_date_reformatted}-audiomoth-(\w+)\.(jpg|jpeg|JPG|JPEG)"
for file_name in files:
if re.match(regex_pattern, file_name):
found = True
if not found:
pytest.fail(f"No such file matches the regex pattern {regex_pattern} for the deployment date "
"deployment_date_reformatted.")
pytest.fail(f"No such file matches the regex pattern {regex_pattern} for the deployment date " f"{deployment_date_reformatted}."

2 changes: 1 addition & 1 deletion scripts/tests/test_field_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def is_valid_recovery_date(entry: str) -> bool:
"""
Checks if string is of valid recovery-date.
"""
regex_pattern = r'^recover-(\d{8})|\(RECOVER-DATE\)|^batcatch-(\d{8})$'
regex_pattern = r'^(?:recover-(\d{8})|\(RECOVER-DATE\)|batcatch-(\d{8}))$'
match = re.match(regex_pattern, entry)
if match:
date_str = match.group(1)
Expand Down

0 comments on commit 28d2919

Please sign in to comment.