1
0
Fork 0
mirror of synced 2024-07-03 05:21:02 +12:00
bulk-downloader-for-reddit/bulkredditdownloader/tests/test_configuration.py
Serene 2385867afb Refactor and optimise some tests (#245)
* Rename to follow actual directory name

* Remove unnecessary Reddit call from test

* Refactor test to reduce duplication

* Parameterise some tests

* Standardise formatting
2021-04-18 16:44:51 +03:00

25 lines
616 B
Python

#!/usr/bin/env python3
# coding=utf-8
from unittest.mock import MagicMock
import pytest
from bulkredditdownloader.configuration import Configuration
@pytest.mark.parametrize('arg_dict', (
{'directory': 'test_dir'},
{
'directory': 'test_dir',
'no_dupes': True,
},
))
def test_process_click_context(arg_dict: dict):
test_config = Configuration()
test_context = MagicMock()
test_context.params = arg_dict
test_config.process_click_arguments(test_context)
test_config = vars(test_config)
assert all([test_config[arg] == arg_dict[arg] for arg in arg_dict.keys()])