class TestEtsyAPI(object): """Tests the Etsy API client""" def setup(self): """ For each test, create an esty api connection """ self.etsy_api = EtsyAPI(os.environ["ETSY_API_KEY"]) def test_get_shops(self): resp = self.etsy_api.get_shops(keyword="gifts", limit=50) assert len(resp['results']) == 50 def test_get_shop_listings(self): resp = self.etsy_api.get_shops(keyword="gifts", limit=1) shop_id = resp['results'][0]['shop_id'] resp = self.etsy_api.get_shop_listings(shop_id) assert resp