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