Skip to content

Commit 5292cc1

Browse files
committed
[peertube] test: remove usage of peertube.mastodon.host
It's down for months
1 parent da968cf commit 5292cc1

4 files changed

Lines changed: 52 additions & 50 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeAccountExtractorTest.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@
1919
* Test for {@link PeertubeAccountExtractor}
2020
*/
2121
public class PeertubeAccountExtractorTest {
22-
public static class KDE implements BaseChannelExtractorTest {
22+
23+
public static class Framasoft implements BaseChannelExtractorTest {
2324
private static PeertubeAccountExtractor extractor;
2425

2526
@BeforeClass
2627
public static void setUp() throws Exception {
2728
NewPipe.init(DownloaderTestImpl.getInstance());
2829
// setting instance might break test when running in parallel
29-
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
30+
PeerTube.setInstance(new PeertubeInstance("https://framatube.org", "Framatube"));
3031
extractor = (PeertubeAccountExtractor) PeerTube
31-
.getChannelExtractor("https://peertube.mastodon.host/accounts/kde");
32+
.getChannelExtractor("https://framatube.org/accounts/framasoft");
3233
extractor.fetchPage();
3334
}
3435

@@ -43,22 +44,22 @@ public void testServiceId() {
4344

4445
@Test
4546
public void testName() throws ParsingException {
46-
assertEquals("The KDE Community", extractor.getName());
47+
assertEquals("Framasoft", extractor.getName());
4748
}
4849

4950
@Test
5051
public void testId() throws ParsingException {
51-
assertEquals("accounts/kde", extractor.getId());
52+
assertEquals("accounts/framasoft", extractor.getId());
5253
}
5354

5455
@Test
5556
public void testUrl() throws ParsingException {
56-
assertEquals("https://peertube.mastodon.host/accounts/kde", extractor.getUrl());
57+
assertEquals("https://framatube.org/accounts/framasoft", extractor.getUrl());
5758
}
5859

5960
@Test
6061
public void testOriginalUrl() throws ParsingException {
61-
assertEquals("https://peertube.mastodon.host/accounts/kde", extractor.getOriginalUrl());
62+
assertEquals("https://framatube.org/accounts/framasoft", extractor.getOriginalUrl());
6263
}
6364

6465
/*//////////////////////////////////////////////////////////////////////////
@@ -96,25 +97,25 @@ public void testBannerUrl() {
9697

9798
@Test
9899
public void testFeedUrl() throws ParsingException {
99-
assertEquals("https://peertube.mastodon.host/feeds/videos.xml?accountId=32465", extractor.getFeedUrl());
100+
assertEquals("https://framatube.org/feeds/videos.xml?accountId=3", extractor.getFeedUrl());
100101
}
101102

102103
@Test
103104
public void testSubscriberCount() throws ParsingException {
104-
assertTrue("Wrong subscriber count", extractor.getSubscriberCount() >= 5);
105+
assertTrue("Wrong subscriber count", extractor.getSubscriberCount() >= 500);
105106
}
106107
}
107108

108-
public static class Booteille implements BaseChannelExtractorTest {
109+
public static class FreeSoftwareFoundation implements BaseChannelExtractorTest {
109110
private static PeertubeAccountExtractor extractor;
110111

111112
@BeforeClass
112113
public static void setUp() throws Exception {
113114
NewPipe.init(DownloaderTestImpl.getInstance());
114115
// setting instance might break test when running in parallel
115-
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
116+
PeerTube.setInstance(new PeertubeInstance("https://framatube.org", "Framatube"));
116117
extractor = (PeertubeAccountExtractor) PeerTube
117-
.getChannelExtractor("https://peertube.mastodon.host/api/v1/accounts/booteille");
118+
.getChannelExtractor("https://framatube.org/api/v1/accounts/fsf");
118119
extractor.fetchPage();
119120
}
120121

@@ -139,22 +140,22 @@ public void testServiceId() {
139140

140141
@Test
141142
public void testName() throws ParsingException {
142-
assertEquals("booteille", extractor.getName());
143+
assertEquals("Free Software Foundation", extractor.getName());
143144
}
144145

145146
@Test
146147
public void testId() throws ParsingException {
147-
assertEquals("accounts/booteille", extractor.getId());
148+
assertEquals("accounts/fsf", extractor.getId());
148149
}
149150

150151
@Test
151152
public void testUrl() throws ParsingException {
152-
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getUrl());
153+
assertEquals("https://framatube.org/accounts/fsf", extractor.getUrl());
153154
}
154155

155156
@Test
156157
public void testOriginalUrl() throws ParsingException {
157-
assertEquals("https://peertube.mastodon.host/api/v1/accounts/booteille", extractor.getOriginalUrl());
158+
assertEquals("https://framatube.org/api/v1/accounts/fsf", extractor.getOriginalUrl());
158159
}
159160

160161
/*//////////////////////////////////////////////////////////////////////////
@@ -185,20 +186,19 @@ public void testAvatarUrl() throws ParsingException {
185186
assertIsSecureUrl(extractor.getAvatarUrl());
186187
}
187188

188-
@Ignore
189189
@Test
190190
public void testBannerUrl() throws ParsingException {
191-
assertIsSecureUrl(extractor.getBannerUrl());
191+
assertNull(extractor.getBannerUrl());
192192
}
193193

194194
@Test
195195
public void testFeedUrl() throws ParsingException {
196-
assertEquals("https://peertube.mastodon.host/feeds/videos.xml?accountId=1753", extractor.getFeedUrl());
196+
assertEquals("https://framatube.org/feeds/videos.xml?accountId=8178", extractor.getFeedUrl());
197197
}
198198

199199
@Test
200200
public void testSubscriberCount() throws ParsingException {
201-
assertTrue("Wrong subscriber count", extractor.getSubscriberCount() >= 1);
201+
assertTrue("Wrong subscriber count", extractor.getSubscriberCount() >= 100);
202202
}
203203
}
204204
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeChannelExtractorTest.java

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@
1919
* Test for {@link PeertubeChannelExtractor}
2020
*/
2121
public class PeertubeChannelExtractorTest {
22-
public static class DanDAugeTutoriels implements BaseChannelExtractorTest {
22+
23+
public static class LaQuadratureDuNet implements BaseChannelExtractorTest {
2324
private static PeertubeChannelExtractor extractor;
2425

2526
@BeforeClass
2627
public static void setUp() throws Exception {
2728
NewPipe.init(DownloaderTestImpl.getInstance());
2829
// setting instance might break test when running in parallel
29-
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
30+
PeerTube.setInstance(new PeertubeInstance("https://framatube.org", "Framatube"));
3031
extractor = (PeertubeChannelExtractor) PeerTube
31-
.getChannelExtractor("https://peertube.mastodon.host/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa");
32+
.getChannelExtractor("https://framatube.org/video-channels/lqdn_channel@video.lqdn.fr/videos");
3233
extractor.fetchPage();
3334
}
3435

@@ -43,22 +44,22 @@ public void testServiceId() {
4344

4445
@Test
4546
public void testName() throws ParsingException {
46-
assertEquals("Dan d'Auge tutoriels", extractor.getName());
47+
assertEquals("La Quadrature du Net", extractor.getName());
4748
}
4849

4950
@Test
5051
public void testId() throws ParsingException {
51-
assertEquals("video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa", extractor.getId());
52+
assertEquals("video-channels/lqdn_channel@video.lqdn.fr", extractor.getId());
5253
}
5354

5455
@Test
5556
public void testUrl() throws ParsingException {
56-
assertEquals("https://peertube.mastodon.host/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa", extractor.getUrl());
57+
assertEquals("https://framatube.org/video-channels/lqdn_channel@video.lqdn.fr", extractor.getUrl());
5758
}
5859

5960
@Test
6061
public void testOriginalUrl() throws ParsingException {
61-
assertEquals("https://peertube.mastodon.host/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa", extractor.getOriginalUrl());
62+
assertEquals("https://framatube.org/video-channels/lqdn_channel@video.lqdn.fr/videos", extractor.getOriginalUrl());
6263
}
6364

6465
/*//////////////////////////////////////////////////////////////////////////
@@ -86,12 +87,12 @@ public void testDescription() throws ParsingException {
8687

8788
@Test
8889
public void testParentChannelName() throws ParsingException {
89-
assertEquals("libux", extractor.getParentChannelName());
90+
assertEquals("lqdn", extractor.getParentChannelName());
9091
}
9192

9293
@Test
9394
public void testParentChannelUrl() throws ParsingException {
94-
assertEquals("https://peertube.mastodon.host/accounts/libux", extractor.getParentChannelUrl());
95+
assertEquals("https://video.lqdn.fr/accounts/lqdn", extractor.getParentChannelUrl());
9596
}
9697

9798
@Test
@@ -111,25 +112,26 @@ public void testBannerUrl() throws ParsingException {
111112

112113
@Test
113114
public void testFeedUrl() throws ParsingException {
114-
assertEquals("https://peertube.mastodon.host/feeds/videos.xml?videoChannelId=1361", extractor.getFeedUrl());
115+
assertEquals("https://framatube.org/feeds/videos.xml?videoChannelId=1126", extractor.getFeedUrl());
115116
}
116117

117118
@Test
118119
public void testSubscriberCount() throws ParsingException {
119-
assertTrue("Wrong subscriber count", extractor.getSubscriberCount() >= 4);
120+
assertTrue("Wrong subscriber count", extractor.getSubscriberCount() >= 230);
120121
}
121122
}
122123

123-
public static class Divers implements BaseChannelExtractorTest {
124+
public static class ChatSceptique implements BaseChannelExtractorTest {
125+
124126
private static PeertubeChannelExtractor extractor;
125127

126128
@BeforeClass
127129
public static void setUp() throws Exception {
128130
NewPipe.init(DownloaderTestImpl.getInstance());
129131
// setting instance might break test when running in parallel
130-
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
132+
PeerTube.setInstance(new PeertubeInstance("https://framatube.org", "Framatube"));
131133
extractor = (PeertubeChannelExtractor) PeerTube
132-
.getChannelExtractor("https://peertube.mastodon.host/api/v1/video-channels/35080089-79b6-45fc-96ac-37e4d46a4457");
134+
.getChannelExtractor("https://framatube.org/api/v1/video-channels/chatsceptique@skeptikon.fr");
133135
extractor.fetchPage();
134136
}
135137

@@ -154,22 +156,22 @@ public void testServiceId() {
154156

155157
@Test
156158
public void testName() throws ParsingException {
157-
assertEquals("Divers", extractor.getName());
159+
assertEquals("Chat Sceptique", extractor.getName());
158160
}
159161

160162
@Test
161163
public void testId() throws ParsingException {
162-
assertEquals("video-channels/35080089-79b6-45fc-96ac-37e4d46a4457", extractor.getId());
164+
assertEquals("video-channels/chatsceptique@skeptikon.fr", extractor.getId());
163165
}
164166

165167
@Test
166168
public void testUrl() throws ParsingException {
167-
assertEquals("https://peertube.mastodon.host/video-channels/35080089-79b6-45fc-96ac-37e4d46a4457", extractor.getUrl());
169+
assertEquals("https://framatube.org/video-channels/chatsceptique@skeptikon.fr", extractor.getUrl());
168170
}
169171

170172
@Test
171173
public void testOriginalUrl() throws ParsingException {
172-
assertEquals("https://peertube.mastodon.host/api/v1/video-channels/35080089-79b6-45fc-96ac-37e4d46a4457", extractor.getOriginalUrl());
174+
assertEquals("https://framatube.org/api/v1/video-channels/chatsceptique@skeptikon.fr", extractor.getOriginalUrl());
173175
}
174176

175177
/*//////////////////////////////////////////////////////////////////////////
@@ -197,12 +199,12 @@ public void testDescription() throws ParsingException {
197199

198200
@Test
199201
public void testParentChannelName() throws ParsingException {
200-
assertEquals("booteille", extractor.getParentChannelName());
202+
assertEquals("nathan", extractor.getParentChannelName());
201203
}
202204

203205
@Test
204206
public void testParentChannelUrl() throws ParsingException {
205-
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getParentChannelUrl());
207+
assertEquals("https://skeptikon.fr/accounts/nathan", extractor.getParentChannelUrl());
206208
}
207209

208210
@Test
@@ -215,20 +217,19 @@ public void testAvatarUrl() throws ParsingException {
215217
assertIsSecureUrl(extractor.getAvatarUrl());
216218
}
217219

218-
@Ignore
219220
@Test
220221
public void testBannerUrl() throws ParsingException {
221-
assertIsSecureUrl(extractor.getBannerUrl());
222+
assertNull(extractor.getBannerUrl());
222223
}
223224

224225
@Test
225226
public void testFeedUrl() throws ParsingException {
226-
assertEquals("https://peertube.mastodon.host/feeds/videos.xml?videoChannelId=1227", extractor.getFeedUrl());
227+
assertEquals("https://framatube.org/feeds/videos.xml?videoChannelId=137", extractor.getFeedUrl());
227228
}
228229

229230
@Test
230231
public void testSubscriberCount() throws ParsingException {
231-
assertTrue("Wrong subscriber count", extractor.getSubscriberCount() >= 2);
232+
assertTrue("Wrong subscriber count", extractor.getSubscriberCount() >= 700);
232233
}
233234
}
234235
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeTrendingExtractorTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
import static org.schabi.newpipe.extractor.services.DefaultTests.*;
1414

1515
public class PeertubeTrendingExtractorTest {
16+
1617
public static class Trending implements BaseListExtractorTest {
1718
private static PeertubeTrendingExtractor extractor;
1819

1920
@BeforeClass
2021
public static void setUp() throws Exception {
2122
NewPipe.init(DownloaderTestImpl.getInstance());
2223
// setting instance might break test when running in parallel
23-
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
24+
PeerTube.setInstance(new PeertubeInstance("https://framatube.org", "Framatube"));
2425
extractor = (PeertubeTrendingExtractor) PeerTube.getKioskList()
2526
.getExtractorById("Trending", null);
2627
extractor.fetchPage();
@@ -47,12 +48,12 @@ public void testId() throws Exception {
4748

4849
@Test
4950
public void testUrl() throws ParsingException {
50-
assertEquals("https://peertube.mastodon.host/api/v1/videos?sort=-trending", extractor.getUrl());
51+
assertEquals("https://framatube.org/api/v1/videos?sort=-trending", extractor.getUrl());
5152
}
5253

5354
@Test
5455
public void testOriginalUrl() throws ParsingException {
55-
assertEquals("https://peertube.mastodon.host/api/v1/videos?sort=-trending", extractor.getOriginalUrl());
56+
assertEquals("https://framatube.org/api/v1/videos?sort=-trending", extractor.getOriginalUrl());
5657
}
5758

5859
/*//////////////////////////////////////////////////////////////////////////

extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/search/PeertubeSearchExtractorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ public class PeertubeSearchExtractorTest {
2323

2424
public static class All extends DefaultSearchExtractorTest {
2525
private static SearchExtractor extractor;
26-
private static final String QUERY = "kde";
26+
private static final String QUERY = "fsf";
2727

2828
@BeforeClass
2929
public static void setUp() throws Exception {
3030
NewPipe.init(DownloaderTestImpl.getInstance());
3131
// setting instance might break test when running in parallel
32-
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
32+
PeerTube.setInstance(new PeertubeInstance("https://framatube.org", "Framatube"));
3333
extractor = PeerTube.getSearchExtractor(QUERY);
3434
extractor.fetchPage();
3535
}
@@ -52,7 +52,7 @@ public static class SepiaSearch extends DefaultSearchExtractorTest {
5252
public static void setUp() throws Exception {
5353
NewPipe.init(DownloaderTestImpl.getInstance());
5454
// setting instance might break test when running in parallel
55-
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
55+
PeerTube.setInstance(new PeertubeInstance("https://framatube.org", "Framatube"));
5656
extractor = PeerTube.getSearchExtractor(QUERY, singletonList(PeertubeSearchQueryHandlerFactory.SEPIA_VIDEOS), "");
5757
extractor.fetchPage();
5858
}

0 commit comments

Comments
 (0)