コード例 #1
0
 def test_directory_made(self):
     correct_list = ["y2-uaPiyoxc"]
     youtube_id = correct_list[0]
     file_suffix = '.vtt'
     retrieve_subtitles(correct_list, force=True)
     path = os.getcwd() + "/build/subtitles/en/" + youtube_id + file_suffix
     assert os.path.exists(path)
コード例 #2
0
 def test_directory_made(self):
     correct_list = ["y2-uaPiyoxc"]
     youtube_id = correct_list[0]
     file_suffix = '.vtt'
     retrieve_subtitles(correct_list, force=True)
     path = os.getcwd() + "/build/subtitles/en/" + youtube_id + file_suffix
     assert os.path.exists(path)
コード例 #3
0
 def test_correct_and_incorrect_youtube_id(self):
     mixed_list =  ["y2-uaPiyoxc", "asdadsafa"]
     filled_list = retrieve_subtitles(mixed_list, force=True)
     test_list = ["y2-uaPiyoxc"]
     assert filled_list
     assert isinstance(filled_list, list)
     assert filled_list == test_list
コード例 #4
0
 def test_correct_and_incorrect_youtube_id(self):
     mixed_list = ["y2-uaPiyoxc", "asdadsafa"]
     filled_dict = retrieve_subtitles(mixed_list, force=True)
     test_id = "y2-uaPiyoxc"
     assert filled_dict
     assert isinstance(filled_dict, dict)
     for id, path in filled_dict.items():
         assert id == test_id
         assert os.path.exists(path)
コード例 #5
0
 def test_correct_and_incorrect_youtube_id(self):
     mixed_list = ["y2-uaPiyoxc", "asdadsafa"]
     filled_dict = retrieve_subtitles(mixed_list, force=True)
     test_id = "y2-uaPiyoxc"
     assert filled_dict
     assert isinstance(filled_dict, dict)
     for id, path in filled_dict.items():
         assert id == test_id
         assert os.path.exists(path)
コード例 #6
0
 def test_correct_youtube_id_and_incorrect_langpack(self):
     correct_list = ["y2-uaPiyoxc"]
     empty_dict = retrieve_subtitles(correct_list, "falselang", force=True)
     assert not empty_dict
     assert isinstance(empty_dict, dict)
コード例 #7
0
 def test_correct_youtube_id(self):
     correct_list = ["y2-uaPiyoxc"]
     filled_dict = retrieve_subtitles(correct_list, force=True)
     assert filled_dict
     assert isinstance(filled_dict, dict)
コード例 #8
0
 def test_incorrect_youtube_id(self):
     incorrect_list = ["aaa"]
     empty_dict = retrieve_subtitles(incorrect_list, force=True)
     assert not empty_dict
     assert isinstance(empty_dict, dict)
コード例 #9
0
 def test_correct_youtube_id_and_incorrect_langpack(self):
     correct_list = ["y2-uaPiyoxc"]
     empty_dict = retrieve_subtitles(correct_list, "falselang", force=True)
     assert not empty_dict
     assert isinstance(empty_dict, dict)
コード例 #10
0
 def test_correct_youtube_id(self):
     correct_list = ["y2-uaPiyoxc"]
     filled_dict = retrieve_subtitles(correct_list, force=True)
     assert filled_dict
     assert isinstance(filled_dict, dict)
コード例 #11
0
 def test_incorrect_youtube_id(self):
     incorrect_list = ["aaa"]
     empty_dict = retrieve_subtitles(incorrect_list, force=True)
     assert not empty_dict
     assert isinstance(empty_dict, dict)