mirror of
https://github.com/Dineshkarthik/telegram_media_downloader.git
synced 2024-09-20 07:16:32 +08:00
style: change in black and isort autoformat config
This commit is contained in:
parent
c36b3af158
commit
ef12b4f5e2
|
@ -47,9 +47,7 @@ def update_config(config: dict):
|
|||
logger.info("Updated last read message_id to config file")
|
||||
|
||||
|
||||
def _can_download(
|
||||
_type: str, file_formats: dict, file_format: Optional[str]
|
||||
) -> bool:
|
||||
def _can_download(_type: str, file_formats: dict, file_format: Optional[str]) -> bool:
|
||||
"""
|
||||
Check if the given file format can be downloaded.
|
||||
|
||||
|
|
|
@ -134,9 +134,7 @@ async def mock_process_message(*args, **kwargs):
|
|||
|
||||
|
||||
async def async_process_messages(client, messages, media_types, file_formats):
|
||||
result = await process_messages(
|
||||
client, messages, media_types, file_formats
|
||||
)
|
||||
result = await process_messages(client, messages, media_types, file_formats)
|
||||
return result
|
||||
|
||||
|
||||
|
@ -289,9 +287,7 @@ class MediaDownloaderTestCase(unittest.TestCase):
|
|||
)
|
||||
self.assertEqual(
|
||||
(
|
||||
platform_generic_path(
|
||||
"/root/project/document/sample_document.pdf"
|
||||
),
|
||||
platform_generic_path("/root/project/document/sample_document.pdf"),
|
||||
"pdf",
|
||||
),
|
||||
result,
|
||||
|
@ -495,9 +491,7 @@ class MediaDownloaderTestCase(unittest.TestCase):
|
|||
}
|
||||
update_config(conf)
|
||||
mock_open.assert_called_with("config.yaml", "w")
|
||||
mock_yaml.dump.assert_called_with(
|
||||
conf, mock.ANY, default_flow_style=False
|
||||
)
|
||||
mock_yaml.dump.assert_called_with(conf, mock.ANY, default_flow_style=False)
|
||||
|
||||
@mock.patch("media_downloader.update_config")
|
||||
@mock.patch("media_downloader.pyrogram.Client", new=MockClient)
|
||||
|
|
|
@ -15,12 +15,8 @@ class FileManagementTestCase(unittest.TestCase):
|
|||
def setUp(self):
|
||||
self.this_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
self.test_file = os.path.join(self.this_dir, "file-test.txt")
|
||||
self.test_file_copy_1 = os.path.join(
|
||||
self.this_dir, "file-test-copy1.txt"
|
||||
)
|
||||
self.test_file_copy_2 = os.path.join(
|
||||
self.this_dir, "file-test-copy2.txt"
|
||||
)
|
||||
self.test_file_copy_1 = os.path.join(self.this_dir, "file-test-copy1.txt")
|
||||
self.test_file_copy_2 = os.path.join(self.this_dir, "file-test-copy2.txt")
|
||||
f = open(self.test_file, "w+")
|
||||
f.write("dummy file")
|
||||
f.close()
|
||||
|
|
|
@ -2,6 +2,4 @@
|
|||
|
||||
__version__ = "1.5.1"
|
||||
__license__ = "MIT License"
|
||||
__copyright__ = (
|
||||
"Copyright (C) 2019 Dineshkarthik <https://github.com/Dineshkarthik>"
|
||||
)
|
||||
__copyright__ = "Copyright (C) 2019 Dineshkarthik <https://github.com/Dineshkarthik>"
|
||||
|
|
|
@ -6,9 +6,7 @@ from rich.console import Console
|
|||
from . import __copyright__, __license__, __version__
|
||||
|
||||
APP_VERSION = f"Telegram Media Downloader {__version__}"
|
||||
DEVICE_MODEL = (
|
||||
f"{platform.python_implementation()} {platform.python_version()}"
|
||||
)
|
||||
DEVICE_MODEL = f"{platform.python_implementation()} {platform.python_version()}"
|
||||
SYSTEM_VERSION = f"{platform.system()} {platform.release()}"
|
||||
LANG_CODE = "en"
|
||||
|
||||
|
|
Loading…
Reference in a new issue