Skip to content

Commit b7706f0

Browse files
committed
test: Added simple mocked test for get_items
1 parent eeb1635 commit b7706f0

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/test_api_get_items.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import unittest
2+
from unittest import mock
3+
4+
from amazon_paapi import AmazonApi
5+
from amazon_paapi.helpers import requests
6+
7+
8+
class TestGetItems(unittest.TestCase):
9+
@mock.patch.object(requests, "get_items_response")
10+
def test_get_items(self, mocked_get_items_response):
11+
mocked_get_items_response.return_value = []
12+
amazon = AmazonApi("key", "secret", "tag", "ES")
13+
response = amazon.get_items("ABCDEFGHIJ")
14+
self.assertTrue(isinstance(response, list))

0 commit comments

Comments
 (0)