Permalink
Browse files

Add Variation*

--HG--
extra : convert_revision : svn%3A0c1241d1-2811-0410-b6f5-f555c02b9b86/trunk%4091
  • Loading branch information...
1 parent f9bbc7f commit 7cf38c022e1ac95ed97495647411490a841a9623 bookstack@0c1241d1-2811-0410-b6f5-f555c02b9b86 committed Apr 30, 2007
Showing with 27 additions and 2 deletions.
  1. +2 −2 ecs.py
  2. +25 −0 tests/itemlookup.py
View
@@ -180,7 +180,7 @@ def __buildPlugins():
'Medium': ('EditorialReview', 'Images', 'ItemAttributes', 'OfferSummary', 'Request', 'SalesRank', 'Small'),
'OfferFull': ('Offers',),
'Offers': ('OfferSummary',),
- 'Variation': ('VariationMinimum', 'VariationSummary')
+ 'Variations': ('VariationMinimum', 'VariationSummary')
}
"""
@@ -252,7 +252,7 @@ def __buildPlugins():
'TransactionDetails': ((), (), ('Transactions', 'TransactionItems', 'Shipments'),
('Transaction', 'TransactionItem', 'Shipment'), {}),
'Variations': ((), (), (), (), {}),
- 'VariationMinimum': ((), (), (), (), {}),
+ 'VariationMinimum': ((), (), ('Variations',), ('Variation',), {}),
'VariationImages': ((), (), (), (), {}),
'VariationSummary':((), (), (), (), {})
}
View
@@ -136,6 +136,31 @@ def testTracks(self):
self.assertEqual(cd.Disc[13].Track[5], 'Gotterdammerung: Dritter Aufzug, Zweite Szene: Hoiho!')
self.assertEqual(cd.Disc[4].Track[3], 'Die Walkure: Zweiter Aufzug, Funfte Szene: Zauberfest bezahmt ein Schlaf der Holden Schmerz und Harm')
+ def testVariationMinimum(self):
+ shirts = ecs.ItemLookup('B000EI6M5A', ResponseGroup='VariationMinimum')
+ self.assertEqual(len(shirts), 1)
+ shirt = shirts[0]
+ self.assertEqual(len(shirt.Variations), 17)
+ self.assertEqual(shirt.Variations[0].ASIN, 'B000EG9PLU')
+ self.assertEqual(shirt.Variations[5].ASIN, 'B000EG5DUM')
+
+ def testVariationSummary(self):
+ shirts = ecs.ItemLookup('B000EI6M5A', ResponseGroup='VariationSummary')
+ self.assertEqual(len(shirts), 1)
+ shirt = shirts[0]
+ self.assertEqual(shirt.VariationSummary.HighestPrice.Amount, '699')
+ self.assertEqual(shirt.VariationSummary.LowestPrice.Amount, '699')
+
+
+ def testVariations(self):
+ shirts = ecs.ItemLookup('B000EI6M5A', ResponseGroup='Variations')
+ self.assertEqual(len(shirts), 1)
+ shirt = shirts[0]
+ self.assertEqual(len(shirt.Variations), 17)
+ self.assertEqual(shirt.Variations[0].ASIN, 'B000EG9PLU')
+ self.assertEqual(shirt.Variations[5].ASIN, 'B000EG5DUM')
+ self.assertEqual(shirt.VariationSummary.HighestPrice.Amount, '699')
+ self.assertEqual(shirt.VariationSummary.LowestPrice.Amount, '699')
if __name__ == "__main__" :

0 comments on commit 7cf38c0

Please sign in to comment.