Skip to content

Commit

Permalink
Added descriprion and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
viktoriia-yuzkiv committed May 25, 2017
1 parent 1c2af6e commit 77bc0ec
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
Binary file modified doc/Description of the program.docx
Binary file not shown.
Binary file modified doc/SeriesResearch ADT.docx
Binary file not shown.
40 changes: 40 additions & 0 deletions tests/test_my_research.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from modules.my_research import *

series = MainResearch()


def test_actors():
"""
>>> test_actors()
[('Jesse Plemons', 3), ('Martin Freeman', 3)]
"""
actors_list = []
allactors = series.popular_actors()
for key, val in allactors.items():
if val > 1:
actors_list.append((key, val))
a = sorted(actors_list, key=lambda x: x[1], reverse=True)[0:2]
return sorted(a, key=lambda x: x[0])


def test_seasons():
"""
>>> test_seasons()
[('The Simpsons', 29), ('Doctor Who', 27), ('ER', 16)]
"""
allseasons = series.series_seasons()
return sorted(allseasons.items(), key=lambda x: x[1], reverse=True)[0:3]


def test_titles():
"""
>>> test_titles()
[('The', 16), ('And', 3)]
"""
alltitles = series.series_titles()
return sorted(alltitles.items(), key=lambda x: x[1], reverse=True)[0:2]


test_actors()
test_seasons()
test_titles()

0 comments on commit 77bc0ec

Please sign in to comment.