Skip to content

Commit

Permalink
report on stuff... but at what cost? new qa
Browse files Browse the repository at this point in the history
  • Loading branch information
colinxfleming committed Jan 14, 2019
1 parent 154be5d commit e726253
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
31 changes: 31 additions & 0 deletions remaining_report.py
@@ -0,0 +1,31 @@
#!/usr/bin/env python

"""A quick and dirty script to log what episodes still need review."""

import os

import yaml

basedir = os.path.dirname(os.path.realpath(__file__))

all_data = {'episodes': [], 'characters': []}

for datatype in all_data.keys():
data_files = os.listdir(os.path.join(basedir, datatype))
for f in data_files:
content = yaml.load(
open(os.path.join(basedir, datatype, f)))
all_data[datatype] = all_data[datatype] + content[datatype]

all_data['episodes'].sort(key=lambda x: (x['season'], x['episode']))
all_data['characters'].sort(key=lambda x: (x['short_name']))

print('***EPISODE GOODNESS/BADNESS TO REVIEW***\n')
for ep in all_data['episodes']:
if isinstance(ep['good'], str):
print(f"{ep['season']}-{ep['episode']} - {ep['title']}")

print('\nEPISODES TO LOG CHARACTERS')
for ep in all_data['episodes']:
if ep['characters'] is None:
print(f"{ep['season']}-{ep['episode']} - {ep['title']}")
4 changes: 3 additions & 1 deletion test_build.py
Expand Up @@ -31,9 +31,11 @@

# Season should be an int
assert isinstance(episode['season'], int)
# assert episode['season'] < 50

# Episode should be an int
assert isinstance(episode['episode'], int)
# assert episode['episode'] < 50

# Description should be a string
assert isinstance(episode['description'], str)
Expand All @@ -54,7 +56,7 @@
if char['short_name'] == character)

# Season-Episode pair should be unique
assert len(all_episodes) == len(set(f"#{ep['season']}-#{ep['episode']}"
assert len(all_episodes) == len(set(f"{ep['season']}-{ep['episode']}"
for ep in all_episodes))

# CHARACTER QA #
Expand Down

0 comments on commit e726253

Please sign in to comment.