Skip to content

Commit

Permalink
Add simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
Serene-Arc committed Jul 22, 2022
1 parent af3f98f commit 27ca92e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 6 additions & 0 deletions tests/yaml_test_configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
limit: 10
sort: new
subreddit:
- EarthPorn
- TwoXChromosomes
- Mindustry

0 comments on commit 27ca92e

Please sign in to comment.