Add simple test
This commit is contained in:
parent
af3f98f59c
commit
27ca92ef15
2 changed files with 15 additions and 0 deletions
|
@ -22,3 +22,12 @@ def test_process_click_context(arg_dict: 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()])
|
||||
|
||||
|
||||
def test_yaml_file_read():
|
||||
file = './yaml_test_configuration.yaml'
|
||||
test_config = Configuration()
|
||||
test_config.parse_yaml_options(file)
|
||||
assert test_config.subreddit == ['EarthPorn', 'TwoXChromosomes', 'Mindustry']
|
||||
assert test_config.sort == 'new'
|
||||
assert test_config.limit == 10
|
||||
|
|
6
tests/yaml_test_configuration.yaml
Normal file
6
tests/yaml_test_configuration.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
limit: 10
|
||||
sort: new
|
||||
subreddit:
|
||||
- EarthPorn
|
||||
- TwoXChromosomes
|
||||
- Mindustry
|
Loading…
Reference in a new issue