generated from mlibrary/python-starter
-
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.
adds function that lists files send to s3 in the last two weeks
- Loading branch information
Showing
2 changed files
with
49 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
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,33 @@ | ||
import json | ||
from aim.digifeeds.functions import rclone, barcodes_added_in_last_two_weeks | ||
|
||
|
||
def test_barcodes_added_in_last_two_weeks(mocker): | ||
ls_data_raw = """ | ||
[ | ||
{ | ||
"Path": "35112203951670.zip", | ||
"Name": "35112203951670.zip", | ||
"Size": 554562627, | ||
"MimeType": "application/zip", | ||
"ModTime": "2024-12-14T02:01:05.093051502-05:00", | ||
"IsDir": false, | ||
"Tier": "STANDARD" | ||
}, | ||
{ | ||
"Path": "39015004707009.zip", | ||
"Name": "39015004707009.zip", | ||
"Size": 232895588, | ||
"MimeType": "application/zip", | ||
"ModTime": "2024-12-14T02:02:29.111076546-05:00", | ||
"IsDir": false, | ||
"Tier": "STANDARD" | ||
} | ||
] | ||
""" | ||
mocker.patch.object(rclone, "ls", return_value=json.loads(ls_data_raw)) | ||
output = barcodes_added_in_last_two_weeks() | ||
assert output == [ | ||
["2024-12-14", "35112203951670"], | ||
["2024-12-14", "39015004707009"], | ||
] |