diff --git a/doc/Description of the program.docx b/doc/Description of the program.docx index c153b76..ca276c3 100644 Binary files a/doc/Description of the program.docx and b/doc/Description of the program.docx differ diff --git a/doc/SeriesResearch ADT.docx b/doc/SeriesResearch ADT.docx index 9584714..4ebac7b 100644 Binary files a/doc/SeriesResearch ADT.docx and b/doc/SeriesResearch ADT.docx differ diff --git a/tests/test_my_research.py b/tests/test_my_research.py new file mode 100644 index 0000000..8d90f7d --- /dev/null +++ b/tests/test_my_research.py @@ -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()