diff options
author | Allan Wang <me@allanwang.ca> | 2019-09-08 00:51:13 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-09-08 00:51:13 -0700 |
commit | 8cf499946b0e0b52c8d66b2b213982f75e4ee91d (patch) | |
tree | 851cc6cf0fd295c142be123a19320b578fc8be0a /app/src/test | |
parent | 329b31175289fc7ad204204e6f7276fd96530f99 (diff) | |
parent | ea3a1968407ef66c3074593d6768a559e18b0675 (diff) | |
download | frost-8cf499946b0e0b52c8d66b2b213982f75e4ee91d.tar.gz frost-8cf499946b0e0b52c8d66b2b213982f75e4ee91d.tar.bz2 frost-8cf499946b0e0b52c8d66b2b213982f75e4ee91d.zip |
Merge branch 'dev' into theme
Diffstat (limited to 'app/src/test')
-rw-r--r-- | app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt | 24 | ||||
-rw-r--r-- | app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt | 1 |
2 files changed, 20 insertions, 5 deletions
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt index ca842ed9..7e13e6dc 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt @@ -31,7 +31,11 @@ class FbUrlTest { @Suppress("NOTHING_TO_INLINE") inline fun assertFbFormat(expected: String, url: String) { val fbUrl = FbUrlFormatter(url) - assertEquals(expected, fbUrl.toString(), "FbUrl Mismatch:\n${fbUrl.toLogList().joinToString("\n\t")}") + assertEquals( + expected, + fbUrl.toString(), + "FbUrl Mismatch:\n${fbUrl.toLogList().joinToString("\n\t")}" + ) } @Test @@ -65,8 +69,10 @@ class FbUrlTest { @Test fun ampersand() { - val url = "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" - val formattedUrl = "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" + val url = + "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" + val formattedUrl = + "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" assertFbFormat(formattedUrl, url) } @@ -101,7 +107,7 @@ class FbUrlTest { val url = "/video_redirect/?src=https%3A%2F%2Fvideo-yyz1-1.xx.fbcdn.net%2Fv%2Ft42.1790-2%2F2349078999904_n.mp4%3Fefg%3DeyJ87J9%26oh%3Df5777784%26oe%3D56FD4&source=media_collage&id=1735049&refid=8&_ft_=qid.6484464%3Amf_story_key.-43172431214%3Atop_level_post_id.102773&__tn__=FEH-R" val expected = - "https://video-yyz1-1.xx.fbcdn.net/v/t42.1790-2/2349078999904_n.mp4?efg=eyJ87J9&oh=f5777784&oe=56FD4&source=media_collage&id=1735049&_ft_=qid.6484464:mf_story_key.-43172431214:top_level_post_id.102773&__tn__=FEH-R" + "https://video-yyz1-1.xx.fbcdn.net/v/t42.1790-2/2349078999904_n.mp4?efg=eyJ87J9&oh=f5777784&oe=56FD4&source=media_collage&id=1735049&__tn__=FEH-R" assertFbFormat(expected, url) } @@ -138,10 +144,18 @@ class FbUrlTest { @Test fun viewFullImage() { - val url = "https://scontent-yyz1-1.xx.fbcdn.net/v/t1.0-9/fr/cp0/e15/q65/asdf_n.jpg?efg=asdf&oh=asdf&oe=asdf" + val url = + "https://scontent-yyz1-1.xx.fbcdn.net/v/t1.0-9/fr/cp0/e15/q65/asdf_n.jpg?efg=asdf&oh=asdf&oe=asdf" assertFbFormat(url, "#!$url") } + @Test + fun queryFt() { + val url = "${FB_URL_BASE}sample/photos/a.12346/?source=48&_ft_=xxx" + val expected = "${FB_URL_BASE}sample/photos/a.12346/?source=48" + assertFbFormat(expected, url) + } + // @Test // fun viewFullImageIndirect() { // val urlBase = "photo/view_full_size/?fbid=1234&ref_component=mbasic_photo_permalink&ref_page=%2Fwap%2Fphoto.php&refid=13&_ft_=qid.1234%3Amf_story_key.1234%3Atop_level_post_id" diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt index 8610436a..67f62a40 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt @@ -65,6 +65,7 @@ class FbRequestTest { } @Test + @Ignore("Post requests are now experimental") fun markNotification() { val notifId = 1514443903880 AUTH.markNotificationRead(notifId).call.assertNoError() |