aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-10-08 15:18:02 +0300
committerFilipp Lepalaan <f@230.to>2013-10-08 15:18:02 +0300
commit23258a4291d5419a553c8591e38cb8ad80927a89 (patch)
tree70840bb87796718458a2bd5267e449836573336d
parent7cec1e997840b2b3b2decab789c5f0f4a2fe23e5 (diff)
downloadpy-gsxws-23258a4291d5419a553c8591e38cb8ad80927a89.tar.gz
py-gsxws-23258a4291d5419a553c8591e38cb8ad80927a89.tar.bz2
py-gsxws-23258a4291d5419a553c8591e38cb8ad80927a89.zip
Added parts argument to component check
-rw-r--r--gsxws/lookups.py15
-rw-r--r--tests/test_gsxws.py11
2 files changed, 15 insertions, 11 deletions
diff --git a/gsxws/lookups.py b/gsxws/lookups.py
index ea9143a..6a91e90 100644
--- a/gsxws/lookups.py
+++ b/gsxws/lookups.py
@@ -62,22 +62,17 @@ class Lookup(GsxObject):
result.invoiceData = outfile.name
return result
- def component_check(self):
+ def component_check(self, parts=[]):
"""
The Component Check API allows service providers to send
the information required to create a repair and check if
the repair is eligible for component serial number verification
for certain components listed in response.
- If service providers will not be able to provide these component
- serial numbers, the repairs will not be created until service providers
- choose an option to send the repair for Component Check Review.
- GSX validates the information and, if all the validations go through,
- it obtains a status message explaining if the repair
- is eligible for Component Serial Number verification
- and lists the component codes for which component serial numbers are required.
"""
- return self._submit("repairData", "ComponentCheck",
- "componentCheckDetails")
+ if parts:
+ self.orderLines = parts
+
+ return self._submit("repairData", "ComponentCheck", "componentCheckDetails")
if __name__ == '__main__':
diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py
index 952c6fc..432ed64 100644
--- a/tests/test_gsxws.py
+++ b/tests/test_gsxws.py
@@ -8,7 +8,7 @@ from unittest import main, skip, TestCase
from gsxws.objectify import parse
from gsxws.products import Product
-from gsxws import repairs, escalations, lookups, GsxError
+from gsxws import repairs, escalations, lookups, GsxError, ServicePart
class RemoteTestCase(TestCase):
@@ -41,6 +41,15 @@ class TestLookupFunctions(RemoteTestCase):
r = l.component_check()
self.assertFalse(r.eligibility)
+ def test_component_check_with_parts(self):
+ l = lookups.Lookup(serialNumber=env['GSX_SN'])
+ l.repairStrategy = "CA"
+ l.shipTo = env['GSX_SHIPTO']
+ part = ServicePart('661-5502')
+ part.symptomCode = 'H06'
+ r = l.component_check([part])
+ self.assertFalse(r.eligibility)
+
class TestEscalationFunctions(RemoteTestCase):
@skip("Skip")