def testshorten(self): bitly = BitLy(BITLY_LOGIN, BITLY_API_KEY) url = 'www.yahoo.com' self.assertEquals('http://bit.ly/bxUHoc', bitly.shorten(url)['results']['http://' + url]['shortUrl']) self.assertEquals(2, bitly.stats('http://bit.ly/bxUHoc')['results']['userClicks'])