-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refine generate_filename method and test
- Loading branch information
Showing
3 changed files
with
22 additions
and
3 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
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
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,12 @@ | ||
import datetime | ||
from nad_ch.domain.entities import DataProvider, DataSubmission | ||
|
||
|
||
def test_data_submission_generates_filename(): | ||
provider = DataProvider("Some Provider") | ||
filename = DataSubmission.generate_filename("someupload.zip", provider) | ||
todays_date = datetime.datetime.now().strftime("%Y%m%d") | ||
print(filename) | ||
assert filename.startswith("some_provider") | ||
assert todays_date in filename | ||
assert filename.endswith(".zip") |