def test_venues_tips(self): api = API(self.auth) r = api.venues_tips(id='4bb0e776f964a52099683ce3') self.assert_(isinstance(r[0], Tip)) r = api.venues_tips(id='40a55d80f964a52020f31ee3', limit=10, offset=0) self.assert_(isinstance(r[0], Tip)) self.assertEquals(len(r), 10) r = api.venues_tips(id='40a55d80f964a52020f31ee3', limit=10, offset=10) self.assertEquals(len(r), 10)
def test_venues_search(self): api = API(self.auth) result = api.venues_search(query='Burburinho', ll='-8.063542,-34.872891') self.assertEquals('Burburinho', result[0].name) #Without authentication basic_auth = BasicAuthHandler(TestAuthentication.CLIENT_ID, TestAuthentication.CLIENT_SECRET, TestAuthentication.REDIRECT_URI) api = API(basic_auth) result = api.venues_search(query='Burburinho', ll='-8.063542,-34.872891') self.assertEquals('Burburinho', result[0].name) self.assertRaises(FoursquareError, api.venues_tips, id='4bb0e776f964a52099683ce3')
def test_create_api(self): api = API(self.auth) self.assertEquals(api.auth, self.auth) self.assertEquals(api.host, 'api.foursquare.com') self.assertEquals(api.api_root, '/v2') self.assertEquals(api.retry_errors, None) self.assertEquals(api.retry_count, 0) self.assertEquals(api.retry_delay, 0)
def _test_venues_tips(self): api = API(self.auth) print api.venues_tips(id='4bb0e776f964a52099683ce3')
def test_venues_search(self): api = API(self.auth) result = api.venues_search(query='Burburinho', ll='-8.063542,-34.872891') print result print dir(result[0]) print result[0].name
def test_users(self): api = API(self.auth) r = api.users(id='self') self.assert_(isinstance(r, User)) self.assert_(isinstance(r.friends()[0], User)) self.assertEquals(len(r.checkins()), 20)
def test_venues(self): api = API(self.auth) self.assertEquals('Burburinho', api.venues(id='4bb0e776f964a52099683ce3').name)