Closed parthrbhatt closed 9 years ago
Error with TinyURL is intermittent and not really a lib issue.
Following are the Errors / Failures:
1] test_write_qr_image (ut_bitly.TestBitly) ... ERROR 2] test_write_qr_image_v2 (ut_bitly.TestBitly) ... ERROR 3] test_shorten_url (ut_gitio.TestGitio) ... FAIL
bit.ly has stopped offering qrcode generation (source: http://www.followmesticker.com/blog/275-bit-ly-stops-offering-qr-code-generation-use-goo-gl). That explains (1) and (2). (3) should be fixed.
Following is a log of a UT run:
$ python test_pyshorturl.py
Testing Goo.gl API
test_expand_url_with_key (ut_googl.TestGoogl) ... ok test_expand_url_without_key (ut_googl.TestGoogl) ... ok test_shorten_url_with_key (ut_googl.TestGoogl) ... ok test_shorten_url_without_key (ut_googl.TestGoogl) ... ok test_write_qr_image (ut_googl.TestGoogl) ... ok
Ran 5 tests in 1.843s
OK
Testing Bit.ly (j.mp & bitly.com) API
test_expand_url (ut_bitly.TestBitly) ... ok test_expand_url_v2 (ut_bitly.TestBitly) ... ok test_shorten_url (ut_bitly.TestBitly) ... ok test_shorten_url_v2 (ut_bitly.TestBitly) ... ok test_shorten_url_with_domain (ut_bitly.TestBitly) ... ok test_validate (ut_bitly.TestBitly) ... ok test_write_qr_image (ut_bitly.TestBitly) ... ERROR test_write_qr_image_v2 (ut_bitly.TestBitly) ... ERROR
ERROR: test_write_qr_image (ut_bitly.TestBitly)
Traceback (most recent call last): File "/Users/parthbhatt/workspace/projects/pyShortUrl/tests/ut_bitly.py", line 49, in test_write_qr_image service.write_qr_image(self.test_short_url, self.qr_image_path) File "/Users/parthbhatt/workspace/projects/pyShortUrl/pyshorturl/ShortUrl/base_shortener.py", line 67, in write_qr_image image_data = self.get_qr_code(short_url) File "/Users/parthbhatt/workspace/projects/pyShortUrl/pyshorturl/ShortUrl/bit_ly.py", line 139, in get_qr_code headers, response = self._do_http_request(qr_url) File "/Users/parthbhatt/workspace/projects/pyShortUrl/pyshorturl/ShortUrl/base_shortener.py", line 34, in _do_http_request raise ShortenerServiceError('%s:%s' %(e.code, e.msg)) ShortenerServiceError: 410:Gone
ERROR: test_write_qr_image_v2 (ut_bitly.TestBitly)
Traceback (most recent call last): File "/Users/parthbhatt/workspace/projects/pyShortUrl/tests/ut_bitly.py", line 75, in test_write_qr_image_v2 service.write_qr_image(self.test_short_url, self.qr_image_path) File "/Users/parthbhatt/workspace/projects/pyShortUrl/pyshorturl/ShortUrl/base_shortener.py", line 67, in write_qr_image image_data = self.get_qr_code(short_url) File "/Users/parthbhatt/workspace/projects/pyShortUrl/pyshorturl/ShortUrl/bit_ly.py", line 139, in get_qr_code headers, response = self._do_http_request(qr_url) File "/Users/parthbhatt/workspace/projects/pyShortUrl/pyshorturl/ShortUrl/base_shortener.py", line 34, in _do_http_request raise ShortenerServiceError('%s:%s' %(e.code, e.msg)) ShortenerServiceError: 410:Gone
Ran 8 tests in 0.639s
FAILED (errors=2)
Testing git.io API
test_expand_url (ut_gitio.TestGitio) ... ok test_shorten_url (ut_gitio.TestGitio) ... FAIL
FAIL: test_shorten_url (ut_gitio.TestGitio)
Traceback (most recent call last): File "/Users/parthbhatt/workspace/projects/pyShortUrl/tests/ut_gitio.py", line 21, in test_shorten_url self.assertEqual(self.test_short_url, generated_short_url) AssertionError: 'http://git.io/help' != 'http://git.io/PUikkQ'
Ran 2 tests in 0.503s
FAILED (failures=1)
Testing TinyUrl.com API
test_expand_url (ut_tinyurlcom.TestTinyUrlcom) ... FAIL test_shorten_url (ut_tinyurlcom.TestTinyUrlcom) ... ok
FAIL: test_expand_url (ut_tinyurlcom.TestTinyUrlcom)
Traceback (most recent call last): File "/Users/parthbhatt/workspace/projects/pyShortUrl/tests/ut_tinyurlcom.py", line 27, in test_expand_url self.assertEqual(self.test_long_url, generated_long_url) AssertionError: 'http://www.parthbhatt.com/blog/' != 'http://tinyurl.com/8yuvzl5'
Ran 2 tests in 0.739s
FAILED (failures=1)
Testing v.gd API
test_expand_url (ut_vgd.TestVgd) ... ok test_shorten_url (ut_vgd.TestVgd) ... ok test_shorten_url_with_stats (ut_vgd.TestVgd) ... ok
Ran 3 tests in 0.701s
OK
Testing is.gd API
test_expand_url (ut_isgd.TestIsgd) ... ok test_shorten_url (ut_isgd.TestIsgd) ... ok test_shorten_url_with_stats (ut_isgd.TestIsgd) ... ok
Ran 3 tests in 0.713s
OK