Fix PR review

Rename "ParentChannel" to "SubChannel"
Add Tests for sub-channel info fetching
This commit is contained in:
Roy Yosef
2020-04-16 15:19:36 +03:00
committed by wb9688
parent 1de1f97cf1
commit a408661771
15 changed files with 113 additions and 96 deletions

View File

@@ -85,13 +85,13 @@ public class PeertubeChannelExtractorTest {
}
@Test
public void testParentChannelName() throws ParsingException {
assertEquals("libux", extractor.getParentChannelName());
public void testSubChannelName() throws ParsingException {
assertEquals("libux", extractor.getSubChannelName());
}
@Test
public void testParentChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/libux", extractor.getParentChannelUrl());
public void testSubChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/libux", extractor.getSubChannelUrl());
}
@Test
@@ -192,13 +192,13 @@ public class PeertubeChannelExtractorTest {
}
@Test
public void testParentChannelName() throws ParsingException {
assertEquals("booteille", extractor.getParentChannelName());
public void testSubChannelName() throws ParsingException {
assertEquals("booteille", extractor.getSubChannelName());
}
@Test
public void testParentChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getParentChannelUrl());
public void testSubChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getSubChannelUrl());
}
@Test

View File

@@ -87,6 +87,33 @@ public class PeertubeStreamExtractorDefaultTest {
assertEquals("Framasoft", extractor.getUploaderName());
}
@Test
public void testGetUploaderUrl() throws ParsingException {
assertIsSecureUrl(extractor.getUploaderUrl());
assertEquals("https://framatube.org/api/v1/accounts/framasoft@framatube.org", extractor.getUploaderUrl());
}
@Test
public void testGetUploaderAvatarUrl() throws ParsingException {
assertIsSecureUrl(extractor.getUploaderAvatarUrl());
}
@Test
public void testGetSubChannelName() throws ParsingException {
assertEquals("Les vidéos de Framasoft", extractor.getSubChannelName());
}
@Test
public void testGetSubChannelUrl() throws ParsingException {
assertIsSecureUrl(extractor.getSubChannelUrl());
assertEquals("https://framatube.org/video-channels/bf54d359-cfad-4935-9d45-9d6be93f63e8", extractor.getSubChannelUrl());
}
@Test
public void testGetSubChannelAvatarUrl() throws ParsingException {
assertIsSecureUrl(extractor.getSubChannelAvatarUrl());
}
@Test
public void testGetLength() throws ParsingException {
assertEquals(113, extractor.getLength());
@@ -98,22 +125,11 @@ public class PeertubeStreamExtractorDefaultTest {
extractor.getViewCount() > 10);
}
@Test
public void testGetUploaderUrl() throws ParsingException {
assertIsSecureUrl(extractor.getUploaderUrl());
assertEquals("https://framatube.org/api/v1/accounts/framasoft@framatube.org", extractor.getUploaderUrl());
}
@Test
public void testGetThumbnailUrl() throws ParsingException {
assertIsSecureUrl(extractor.getThumbnailUrl());
}
@Test
public void testGetUploaderAvatarUrl() throws ParsingException {
assertIsSecureUrl(extractor.getUploaderAvatarUrl());
}
@Test
public void testGetVideoStreams() throws IOException, ExtractionException {
assertFalse(extractor.getVideoStreams().isEmpty());