From 20709c67a12fcddaf4a855a630cd35714ebe4021 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 20 Oct 2015 22:16:55 +0300 Subject: Added repair strategies --- gsxws/products.py | 8 ++++++++ tests/test_gsxws.py | 3 +++ 2 files changed, 11 insertions(+) diff --git a/gsxws/products.py b/gsxws/products.py index b268457..281c097 100644 --- a/gsxws/products.py +++ b/gsxws/products.py @@ -98,6 +98,14 @@ class Product(object): self.productDescription = self.warrantyDetails.productDescription self.description = self.productDescription.lstrip('~VIN,') + self.repair_strategies = [] + + try: + for i in self.warrantyDetails.availableRepairStrategies: + self.repair_strategies.append(i.availableRepairStrategy) + except AttributeError: + pass + return self.warrantyDetails def parts(self): diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py index ad32fa8..db0c10d 100644 --- a/tests/test_gsxws.py +++ b/tests/test_gsxws.py @@ -348,6 +348,9 @@ class TestRemoteWarrantyFunctions(TestCase): self.product = Product(os.getenv('GSX_SN')) self.wty = self.product.warranty(ship_to=os.getenv('GSX_SHIPTO')) + def test_repair_strategies(self): + self.assertEqual(self.product.repair_strategies[0], 'Carry-in') + def test_acplus_status(self): self.assertTrue(self.wty.acPlusFlag) -- cgit v1.2.3