Giter VIP home page Giter VIP logo

pyshorturl's Issues

git.io UTs are failing

Git.io has gone https (for good reasons). Update the lib so we continue to work with the service.

Add a wiki page containing info about supported services.

Depending upon the service that the user wants to use this lib for, (s)he may need to have an API key and/or an account (login). Add a wiki page dedicated to explaining various details about all the services.

This wiki should at least include the following for each service:

  1. How to obtain login account / API key for the service.
  2. What rate limiting is imposed by the service.
  3. Link to the API reference doc that this lib implements.
  4. Any additional notes that the user should be aware of.

Fix Unit Test failures.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.