Skip to content

Commit 70d9e38

Browse files
committed
[Bandcamp] Add tests for external bandcamp artists
Necessary, because the external pages tested before were converted to bandcamp.com pages. See f9d0625
1 parent f9d0625 commit 70d9e38

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampChannelLinkHandlerFactoryTest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public void testAcceptUrl() throws ParsingException {
2929
assertTrue(linkHandler.acceptUrl("http://zachbenson.bandcamp.com"));
3030
assertTrue(linkHandler.acceptUrl("https://zachbenson.bandcamp.com/"));
3131
assertTrue(linkHandler.acceptUrl("https://billwurtz.bandcamp.com/releases"));
32+
assertTrue(linkHandler.acceptUrl("https://interovgm.bandcamp.com/releases"));
33+
assertTrue(linkHandler.acceptUrl("https://interovgm.bandcamp.com/releases/"));
3234

3335
assertTrue(linkHandler.acceptUrl("http://zachbenson.bandcamp.com/"));
3436

@@ -38,8 +40,9 @@ public void testAcceptUrl() throws ParsingException {
3840
assertFalse(linkHandler.acceptUrl("https://daily.bandcamp.com/best-of-2020/bandcamp-daily-staffers-on-their-favorite-albums-of-2020"));
3941

4042
// External URLs
41-
assertTrue(linkHandler.acceptUrl("https://interovgm.bandcamp.com/releases"));
42-
assertTrue(linkHandler.acceptUrl("https://interovgm.bandcamp.com/releases/"));
43+
assertTrue(linkHandler.acceptUrl("https://lobstertheremin.com"));
44+
assertTrue(linkHandler.acceptUrl("https://lobstertheremin.com/music"));
45+
assertTrue(linkHandler.acceptUrl("https://lobstertheremin.com/music/"));
4346

4447
assertFalse(linkHandler.acceptUrl("https://example.com/releases"));
4548
}
@@ -51,13 +54,18 @@ public void testGetId() throws ParsingException {
5154
assertEquals("1581461772", linkHandler.getId("https://interovgm.bandcamp.com/releases"));
5255
assertEquals("3321800855", linkHandler.getId("https://infiniteammo.bandcamp.com/"));
5356
assertEquals("3775652329", linkHandler.getId("https://npet.bandcamp.com/"));
57+
58+
assertEquals("2735462545", linkHandler.getId("http://lobstertheremin.com/"));
59+
assertEquals("2735462545", linkHandler.getId("https://lobstertheremin.com/music/"));
5460
}
5561

5662
@Test
5763
public void testGetUrl() throws ParsingException {
5864
assertEquals("https://macbenson.bandcamp.com", linkHandler.getUrl("1196681540"));
5965
assertEquals("https://interovgm.bandcamp.com", linkHandler.getUrl("1581461772"));
6066
assertEquals("https://infiniteammo.bandcamp.com", linkHandler.getUrl("3321800855"));
67+
68+
assertEquals("https://lobstertheremin.com", linkHandler.getUrl("2735462545"));
6169
}
6270

6371
@Test(expected = ParsingException.class)

extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamLinkHandlerFactoryTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@ public void testAcceptUrl() throws ParsingException {
4949
assertTrue(linkHandler.acceptUrl("https://interovgm.bandcamp.com/track/title"));
5050
assertTrue(linkHandler.acceptUrl("http://bandcamP.com/?show=38"));
5151
assertTrue(linkHandler.acceptUrl("https://goodgoodblood-tl.bandcamp.com/track/when-it-all-wakes-up"));
52+
assertTrue(linkHandler.acceptUrl("https://lobstertheremin.com/track/unfinished"));
5253
}
5354
}

0 commit comments

Comments
 (0)