From d9be8e17f41695b1a63714bc14eccd754172cd99 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 23 Oct 2017 19:28:18 +0530 Subject: [PATCH] Add test case to shorten and expand url --- tests/test_bukuDb.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_bukuDb.py b/tests/test_bukuDb.py index 2459add..8e608e3 100644 --- a/tests/test_bukuDb.py +++ b/tests/test_bukuDb.py @@ -575,6 +575,15 @@ class TestBukuDb(unittest.TestCase): elif title == "test": self.assertEqual(from_db[3], parse_tags(["test,tes,est,__04"])) + def test_tnyfy_url(self): + # shorten a well-known url + shorturl = self.bdb.tnyfy_url(url='https://www.google.com', shorten=True) + self.assertEqual(shorturl, 'http://tny.im/yt') + + # expand a well-known short url + url = self.bdb.tnyfy_url(url='http://tny.im/yt', shorten=False) + self.assertEqual(url, 'https://www.google.com') + # def test_browse_by_index(self): # self.fail()