aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_unit.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2013-12-29 23:44:41 +0100
committerMatěj Cepl <mcepl@redhat.com>2013-12-29 23:44:41 +0100
commitdfbb929e6b9985810646a19850268c382820791e (patch)
tree58568875e3ae71a0ba25dbe2a94945ad679cb957 /test/test_unit.py
parent58ec4876d8dd638de14c2ccb3d959c40eadfe2d8 (diff)
downloadgg_scraper-dfbb929e6b9985810646a19850268c382820791e.tar.gz
Collect articles for one topic.
Diffstat (limited to 'test/test_unit.py')
-rw-r--r--test/test_unit.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_unit.py b/test/test_unit.py
new file mode 100644
index 0000000..4674529
--- /dev/null
+++ b/test/test_unit.py
@@ -0,0 +1,20 @@
+import unittest
+import gg_scrapper
+
+IN_URL = 'https://groups.google.com/forum/#!forum/jbrout'
+ORIG_URL = 'http://groups.google.com/d/forum/jbrout'
+EXP_URL = 'https://groups.google.com/forum/' + \
+ '?_escaped_fragment_=forum/jbrout'
+
+
+class TestGGScrapper(unittest.TestCase):
+ def test_URL_conversion(self):
+ obs_URL = gg_scrapper.Group.unenscape_Google_bang_URL(IN_URL)
+ self.assertEqual(obs_URL, EXP_URL)
+
+ def test_do_redirect(self):
+ obs_URL = gg_scrapper.Group.do_redirect(ORIG_URL)
+ self.assertEqual(obs_URL, EXP_URL)
+
+if __name__ == '__main__':
+ unittest.main()