Fixed `PeertubePlaylistExtractorTest`

Also removed the unnecessary ``public`` and reformatted the code a bit
This commit is contained in:
litetex 2022-07-30 14:49:06 +02:00
parent e7c12258f4
commit 504f81036e

View File

@ -20,55 +20,60 @@ public class PeertubePlaylistExtractorTest {
@BeforeAll @BeforeAll
public static void setUp() throws Exception { public static void setUp() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance()); NewPipe.init(DownloaderTestImpl.getInstance());
extractor = (PeertubePlaylistExtractor) PeerTube extractor = (PeertubePlaylistExtractor) PeerTube.getPlaylistExtractor(
.getPlaylistExtractor("https://framatube.org/videos/watch/playlist/96b0ee2b-a5a7-4794-8769-58d8ccb79ab7"); "https://framatube.org/videos/watch/playlist/96b0ee2b-a5a7-4794-8769-58d8ccb79ab7");
extractor.fetchPage(); extractor.fetchPage();
} }
@Test @Test
public void testGetName() throws ParsingException { void testGetName() throws ParsingException {
assertEquals("Shocking !", extractor.getName()); assertEquals("Shocking !", extractor.getName());
} }
@Test @Test
@Disabled("URL changes with every request") @Disabled("URL changes with every request")
public void testGetThumbnailUrl() throws ParsingException { void testGetThumbnailUrl() throws ParsingException {
assertEquals("https://framatube.org/static/thumbnails/playlist-96b0ee2b-a5a7-4794-8769-58d8ccb79ab7.jpg", extractor.getThumbnailUrl()); assertEquals(
"https://framatube.org/static/thumbnails/playlist-96b0ee2b-a5a7-4794-8769-58d8ccb79ab7.jpg",
extractor.getThumbnailUrl());
} }
@Test @Test
public void testGetUploaderUrl() throws ParsingException { void testGetUploaderUrl() throws ParsingException {
assertEquals("https://skeptikon.fr/accounts/metadechoc", extractor.getUploaderUrl()); assertEquals("https://skeptikon.fr/accounts/metadechoc", extractor.getUploaderUrl());
} }
@Test @Test
public void testGetUploaderAvatarUrl() throws ParsingException { void testGetUploaderAvatarUrl() throws ParsingException {
assertEquals("https://framatube.org/lazy-static/avatars/c6801ff9-cb49-42e6-b2db-3db623248115.jpg", extractor.getUploaderAvatarUrl()); assertEquals(
"https://framatube.org/lazy-static/avatars/cd0f781d-0287-4be2-94f1-24cd732337b2.jpg",
extractor.getUploaderAvatarUrl());
} }
@Test @Test
public void testGetUploaderName() throws ParsingException { void testGetUploaderName() throws ParsingException {
assertEquals("Méta de Choc", extractor.getUploaderName()); assertEquals("Méta de Choc", extractor.getUploaderName());
} }
@Test @Test
public void testGetStreamCount() throws ParsingException { void testGetStreamCount() throws ParsingException {
ExtractorAsserts.assertGreaterOrEqual(39, extractor.getStreamCount()); ExtractorAsserts.assertGreaterOrEqual(39, extractor.getStreamCount());
} }
@Test @Test
public void testGetSubChannelUrl() throws ParsingException { void testGetSubChannelUrl() throws ParsingException {
assertEquals("https://skeptikon.fr/video-channels/metadechoc_channel", extractor.getSubChannelUrl()); assertEquals("https://skeptikon.fr/video-channels/metadechoc_channel", extractor.getSubChannelUrl());
} }
@Test @Test
public void testGetSubChannelName() throws ParsingException { void testGetSubChannelName() throws ParsingException {
assertEquals("SHOCKING !", extractor.getSubChannelName()); assertEquals("SHOCKING !", extractor.getSubChannelName());
} }
@Test @Test
public void testGetSubChannelAvatarUrl() throws ParsingException { void testGetSubChannelAvatarUrl() throws ParsingException {
assertEquals("https://framatube.org/lazy-static/avatars/e801ccce-8694-4309-b0ab-e6f0e552ef77.png", assertEquals(
"https://framatube.org/lazy-static/avatars/637753af-fcf2-4b61-88f9-b9857c953457.png",
extractor.getSubChannelAvatarUrl()); extractor.getSubChannelAvatarUrl());
} }
} }