mirror of
https://github.com/Dineshkarthik/telegram_media_downloader.git
synced 2024-12-27 01:03:56 +08:00
enh: setting timezone to utc
This commit is contained in:
parent
2fb0bb8096
commit
c49cbc679f
2 changed files with 3 additions and 3 deletions
|
@ -38,7 +38,7 @@ def _get_media_meta(media_obj: object, _type: str) -> Tuple[str, str]:
|
|||
THIS_DIR,
|
||||
_type,
|
||||
"voice_{}.{}".format(
|
||||
dt.fromtimestamp(media_obj.date).isoformat(), file_format
|
||||
dt.utcfromtimestamp(media_obj.date).isoformat(), file_format
|
||||
),
|
||||
)
|
||||
elif _type == "photo":
|
||||
|
|
|
@ -85,7 +85,7 @@ class MockClient:
|
|||
|
||||
def download_media(self, *args, **kwargs):
|
||||
assert "AwADBQADbwAD2oTRVeHe5eXRFftfAg", args[0]
|
||||
assert "/root/project/voice/voice_2019-07-25T16:53:50.ogg", kwargs[
|
||||
assert "/root/project/voice/voice_2019-07-25T14:53:50.ogg", kwargs[
|
||||
"file_name"
|
||||
]
|
||||
return kwargs["file_name"]
|
||||
|
@ -108,7 +108,7 @@ class MediaDownloaderTestCase(unittest.TestCase):
|
|||
self.assertEqual(
|
||||
(
|
||||
"AwADBQADbwAD2oTRVeHe5eXRFftfAg",
|
||||
"/root/project/voice/voice_2019-07-25T16:53:50.ogg",
|
||||
"/root/project/voice/voice_2019-07-25T14:53:50.ogg",
|
||||
),
|
||||
result,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue