Skip to content

Commit

Permalink
Merge pull request #17 from luigi311/pytest
Browse files Browse the repository at this point in the history
Add Pytest
  • Loading branch information
luigi311 authored Jun 20, 2022
2 parents 2ad6b3a + afb71d8 commit 8b7fc5e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,20 @@ on:
- "*.md"

jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: "Install dependencies"
run: pip install -r requirements.txt && pip install -r test/requirements.txt

- name: "Run tests"
run: pytest -vvv

docker:
runs-on: ubuntu-latest
needs: pytest
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
17 changes: 13 additions & 4 deletions src/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,16 @@ def generate_library_guids_dict(user_list: dict, generate_output: int):
show_output_keys = user_list.keys()
show_output_keys = ([ dict(x) for x in list(show_output_keys) ])
for show_key in show_output_keys:
for provider_key, prvider_value in show_key.items():
for provider_key, provider_value in show_key.items():
# Skip title
if provider_key.lower() == "title":
continue
if provider_key.lower() not in show_output_dict:
show_output_dict[provider_key.lower()] = []
show_output_dict[provider_key.lower()].append(prvider_value.lower())
if provider_key.lower() == "locations":
show_output_dict[provider_key.lower()].append(provider_value)
else:
show_output_dict[provider_key.lower()].append(provider_value.lower())

if generate_output in (1, 3):
for show in user_list:
Expand All @@ -105,14 +108,20 @@ def generate_library_guids_dict(user_list: dict, generate_output: int):
for episode_key, episode_value in episode.items():
if episode_key.lower() not in episode_output_dict:
episode_output_dict[episode_key.lower()] = []
episode_output_dict[episode_key.lower()].append(episode_value.lower())
if episode_key == "locations":
episode_output_dict[episode_key.lower()].append(episode_value)
else:
episode_output_dict[episode_key.lower()].append(episode_value.lower())

if generate_output == 2:
for movie in user_list:
for movie_key, movie_value in movie.items():
if movie_key.lower() not in movies_output_dict:
movies_output_dict[movie_key.lower()] = []
movies_output_dict[movie_key.lower()].append(movie_value.lower())
if movie_key == "locations":
movies_output_dict[movie_key.lower()].append(movie_value)
else:
movies_output_dict[movie_key.lower()].append(movie_value.lower())

return show_output_dict, episode_output_dict, movies_output_dict

Expand Down

0 comments on commit 8b7fc5e

Please sign in to comment.