2

I have a Python 3.8 unit test that used to work fine, and now it is failing. I can't see any documentation that says that the method has been deprecated, and so I'm wondering what's going on here.

The unit tests do this:

  1. Make sure we instantiated the Bottlenose client
  2. Go and look up some product
    def test_amazon_client(self):
        """
        Test that amazon client is created.
        """
        self.assertIsNotNone(self.amazon)

    def test_asin(self):
        """
        Test that amazon client is pulling product data.
        """
        result = self.amazon.ItemLookup(ItemId="B000Q5Z8L0")
        self.assertIsNotNone(result)

When the unit test runs, the output shows a "HTTP 410: Gone" error.

======================================================================
ERROR: test_asin (__main__.TestAmazon)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jasoncoulls/Desktop/WORK/[redacted]/scrap.py", line 28, in test_asin
    result = self.amazon.ItemLookup(ItemId="B000Q5Z8L0")
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bottlenose/api.py", line 273, in __call__
    response = self._call_api(api_url,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bottlenose/api.py", line 235, in _call_api
    return urllib2.urlopen(api_request, timeout=self.Timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 410: Gone

So this leaves me scratching my head.

  1. I made sure I was on up to date boto3 client.
  2. I made sure the item being looked up was valid.
  3. I made sure the client was being instantiated.

Any other pointers would be helpful.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Jason Coulls
  • 182
  • 1
  • 1
  • 10

0 Answers0