Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit bb42029

Browse files
committed
update tests
1 parent 007b4b3 commit bb42029

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

tests/test_resolver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ def test_kodi_listitem(self):
7777
def test_custom_listitem(self):
7878
item = custom_listitem()
7979
item.label = "test"
80-
item.set_callback(u"test.mkv")
80+
item.set_callback(u"http://test.mkv")
8181

8282
self.resolver._process_results(item)
8383
self.assertTrue(plugin_data["succeeded"])
84-
self.assertEqual(plugin_data["resolved"]["path"], u"test.mkv")
84+
self.assertEqual(plugin_data["resolved"]["path"], u"http://test.mkv")
8585

8686
def test_list_single(self):
8787
del plugin_data["playlist"][:]
@@ -192,11 +192,11 @@ def test_playlist_custom_listitem(self):
192192

193193
item = custom_listitem()
194194
item.label = "test"
195-
item.set_callback(u"test.mkv")
195+
item.set_callback(u"http://test.mkv")
196196

197197
self.resolver._process_results([item])
198198
self.assertTrue(plugin_data["succeeded"])
199-
self.assertEqual(plugin_data["resolved"]["path"], u"test.mkv")
199+
self.assertEqual(plugin_data["resolved"]["path"], u"http://test.mkv")
200200

201201
@temp_callback
202202
def test_create_loopback(self):

tests/test_route.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_sortmethod(self):
9595
del plugin_data["sortmethods"][:]
9696

9797
def route_list():
98-
yield Listitem.from_dict("season one", "test.mkv")
98+
yield Listitem.from_dict("http://season one", "test.mkv")
9999

100100
self.route._process_results(route_list())
101101
self.assertTrue(plugin_data["succeeded"])
@@ -106,7 +106,7 @@ def test_sortmethod_date(self):
106106
del plugin_data["sortmethods"][:]
107107

108108
def route_list():
109-
item = Listitem.from_dict("season one", "test.mkv")
109+
item = Listitem.from_dict("http://season one", "test.mkv")
110110
item.info.date("june 27, 2017", "%B %d, %Y")
111111
yield item
112112

@@ -119,7 +119,7 @@ def test_sortmethod_genre(self):
119119
del plugin_data["sortmethods"][:]
120120

121121
def route_list():
122-
yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
122+
yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
123123

124124
self.route._process_results(route_list())
125125
self.assertTrue(plugin_data["succeeded"])
@@ -131,7 +131,7 @@ def test_no_sort(self):
131131

132132
def route_list(plugin):
133133
plugin.autosort = False
134-
yield Listitem.from_dict("season one", "test.mkv")
134+
yield Listitem.from_dict("http://season one", "test.mkv")
135135

136136
self.route._process_results(route_list(self.route))
137137
self.assertTrue(plugin_data["succeeded"])
@@ -143,7 +143,7 @@ def test_no_sort_genre(self):
143143

144144
def route_list(plugin):
145145
plugin.autosort = False
146-
yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
146+
yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
147147

148148
self.route._process_results(route_list(self.route))
149149
self.assertTrue(plugin_data["succeeded"])
@@ -156,7 +156,7 @@ def test_custom_sort_only(self):
156156
def route_list(plugin):
157157
plugin.autosort = False
158158
plugin.add_sort_methods(3)
159-
yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
159+
yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
160160

161161
self.route._process_results(route_list(self.route))
162162
self.assertTrue(plugin_data["succeeded"])
@@ -168,7 +168,7 @@ def test_custom_sort_only_method_2(self):
168168

169169
def route_list(plugin):
170170
plugin.add_sort_methods(3, disable_autosort=True)
171-
yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
171+
yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
172172

173173
self.route._process_results(route_list(self.route))
174174
self.assertTrue(plugin_data["succeeded"])
@@ -180,7 +180,7 @@ def test_custom_sort_with_autosort(self):
180180

181181
def route_list(plugin):
182182
plugin.add_sort_methods(SORT_DATE)
183-
yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
183+
yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
184184

185185
self.route._process_results(route_list(self.route))
186186
self.assertTrue(plugin_data["succeeded"])
@@ -192,8 +192,8 @@ def test_custom_sort_override(self):
192192

193193
def route_list(plugin):
194194
plugin.add_sort_methods(SORT_DATE)
195-
yield Listitem.from_dict("season one", "test.mkv", info={"genre": "test"})
196-
item = Listitem.from_dict("season one", "test.mkv")
195+
yield Listitem.from_dict("http://season one", "test.mkv", info={"genre": "test"})
196+
item = Listitem.from_dict("http://season one", "test.mkv")
197197
item.info.date("june 27, 2017", "%B %d, %Y")
198198
yield item
199199

tests/test_youtube.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def test_playlist_playlist_single_page(self):
5353
self.assertGreaterEqual(len(ret), 10)
5454

5555
def test_playlist_unlisted(self):
56-
ret = route_caller(youtube.Playlist, "PLCnUnV3yCIYt_cgn_1UIU1w2YQ_TfFa6L")
57-
self.assertGreaterEqual(len(ret), 15)
56+
ret = route_caller(youtube.Playlist, "PLh6dr2Pr1VQnPdF29tkfQPgCBJPFnKYEV")
57+
self.assertGreaterEqual(len(ret), 17)
5858

5959
def test_playlist_playlist_muilti_page(self):
6060
ret = route_caller(youtube.Playlist, "PL8mG-RkN2uTx1lbFS8z8wRYS3RrHCp8TG", loop=False)
@@ -80,11 +80,6 @@ def test_playlists_disable_all_link(self):
8080
ret = route_caller(youtube.Playlists, "UCaWd5_7JhbQBe4dknZhsHJg", show_all=False)
8181
self.assertGreaterEqual(len(ret), 50)
8282

83-
@unittest.skip
84-
def test_playvideo(self):
85-
ret = youtube.play_video.test("-QEXPO9zgX8")
86-
self.assertEqual(ret, "plugin://plugin.video.youtube/play/?video_id=-QEXPO9zgX8")
87-
8883
def test_bad_channel_id(self):
8984
with self.assertRaises(KeyError):
9085
route_caller(youtube.Playlist, "UCad5_7JhQBe4dknZhsJg")

0 commit comments

Comments
 (0)