| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 try: | 2 try: |
| 3 from tests.unit import unittest | 3 from tests.unit import unittest |
| 4 except ImportError: | 4 except ImportError: |
| 5 import unittest | 5 import unittest |
| 6 import sys | 6 import sys |
| 7 import os | 7 import os |
| 8 import os.path | 8 import os.path |
| 9 from datetime import datetime, timedelta | 9 from datetime import datetime, timedelta |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 response = self.mws.list_marketplace_participations() | 64 response = self.mws.list_marketplace_participations() |
| 65 result = response.ListMarketplaceParticipationsResult | 65 result = response.ListMarketplaceParticipationsResult |
| 66 self.assertTrue(result.ListMarketplaces.Marketplace[0].MarketplaceId) | 66 self.assertTrue(result.ListMarketplaces.Marketplace[0].MarketplaceId) |
| 67 | 67 |
| 68 @unittest.skipUnless(simple and isolator, "skipping simple test") | 68 @unittest.skipUnless(simple and isolator, "skipping simple test") |
| 69 def test_get_product_categories_for_asin(self): | 69 def test_get_product_categories_for_asin(self): |
| 70 asin = '144930544X' | 70 asin = '144930544X' |
| 71 response = self.mws.get_product_categories_for_asin( | 71 response = self.mws.get_product_categories_for_asin( |
| 72 MarketplaceId=self.marketplace_id, | 72 MarketplaceId=self.marketplace_id, |
| 73 ASIN=asin) | 73 ASIN=asin) |
| 74 result = response._result | 74 self.assertEqual(len(response._result.Self), 3) |
| 75 self.assertTrue(int(result.Self.ProductCategoryId) == 21) | 75 categoryids = [x.ProductCategoryId for x in response._result.Self] |
| 76 self.assertSequenceEqual(categoryids, ['285856', '21', '491314']) |
| 76 | 77 |
| 77 @unittest.skipUnless(simple and isolator, "skipping simple test") | 78 @unittest.skipUnless(simple and isolator, "skipping simple test") |
| 78 def test_list_matching_products(self): | 79 def test_list_matching_products(self): |
| 79 response = self.mws.list_matching_products( | 80 response = self.mws.list_matching_products( |
| 80 MarketplaceId=self.marketplace_id, | 81 MarketplaceId=self.marketplace_id, |
| 81 Query='boto') | 82 Query='boto') |
| 82 products = response._result.Products | 83 products = response._result.Products |
| 83 self.assertTrue(len(products)) | 84 self.assertTrue(len(products)) |
| 84 | 85 |
| 85 @unittest.skipUnless(simple and isolator, "skipping simple test") | 86 @unittest.skipUnless(simple and isolator, "skipping simple test") |
| (...skipping 28 matching lines...) Expand all Loading... |
| 114 | 115 |
| 115 @unittest.skipUnless(simple and isolator, "skipping simple test") | 116 @unittest.skipUnless(simple and isolator, "skipping simple test") |
| 116 def test_list_inventory_supply(self): | 117 def test_list_inventory_supply(self): |
| 117 asof = (datetime.today() - timedelta(days=30)).isoformat() | 118 asof = (datetime.today() - timedelta(days=30)).isoformat() |
| 118 response = self.mws.list_inventory_supply(QueryStartDateTime=asof, | 119 response = self.mws.list_inventory_supply(QueryStartDateTime=asof, |
| 119 ResponseGroup='Basic') | 120 ResponseGroup='Basic') |
| 120 self.assertTrue(hasattr(response._result, 'InventorySupplyList')) | 121 self.assertTrue(hasattr(response._result, 'InventorySupplyList')) |
| 121 | 122 |
| 122 if __name__ == "__main__": | 123 if __name__ == "__main__": |
| 123 unittest.main() | 124 unittest.main() |
| OLD | NEW |