-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""Test functions for parsing metadata.""" | ||
|
||
from datetime import datetime | ||
from prp.parse.metadata import parse_sequence_date_from_run_id | ||
|
||
|
||
def test_parse_sequence_date_from_run_id(): | ||
"""Test parsing of sequencing run id.""" | ||
|
||
# test that a run id from illumina works | ||
date = parse_sequence_date_from_run_id("220214_NB501699_0302_AHJLM7AFX3") | ||
assert date == datetime(2022, 2, 14) | ||
|
||
# test that an unknown id does not work | ||
date = parse_sequence_date_from_run_id("my-unknown-run-id") | ||
assert date == None | ||
|
||
# test that an unknown id does not work | ||
date = parse_sequence_date_from_run_id("my_unknown_run_id") | ||
assert date == None |