def insta_service(cache_coordinates, cache_post_ids): b = Base(settings.insta_access_token) # scan static coordinates try: for c in settings.insta_static_coordinates_to_scan: b.write_igrams_to_file(c[0], c[1], cache_post_ids) time.sleep(settings.insta_sleep_between_calls_in_sec) except Exception as e: print str(e) # scan dynamic coordinates stored in the cache try: for c in cache.get_all_keys(cache_coordinates): b.write_igrams_to_file(c.split(',')[0], c.split(',')[1], cache_post_ids) time.sleep(settings.insta_sleep_between_calls_in_sec) except Exception as e: print str(e)
def test_get_all_keys(self): coord_list = [[58,18],[57,17],[56,16],[55,15]] [self.test_add(i[0], i[1]) for i in coord_list] all_keys = cache.get_all_keys(self.region) self.assertEqual(len(all_keys), len(coord_list))