aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gsxws/repairs.py13
-rw-r--r--tests/test_gsxws.py17
2 files changed, 21 insertions, 9 deletions
diff --git a/gsxws/repairs.py b/gsxws/repairs.py
index b7716ae..d84372c 100644
--- a/gsxws/repairs.py
+++ b/gsxws/repairs.py
@@ -54,9 +54,20 @@ class SymptomIssue(GsxObject):
_namespace = "asp:"
def fetch(self):
+ result = []
self._submit("requestData", "ReportedSymptomIssue",
"ReportedSymptomIssueResponse")
- return self._req.objects.reportedSymptomIssueResponse
+ r = self._req.objects.reportedSymptomIssueResponse
+
+ if r.symptoms is not None:
+ for s in r.symptoms:
+ result.append((s.reportedSymptomCode, s.reportedSymptomDesc,))
+
+ if r.issues is not None:
+ for s in r.issues:
+ result.append((s.reportedIssueCode, s.reportedIssueDesc,))
+
+ return result
class CompTiaCode(GsxObject):
diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py
index 0a8970b..bd2d8b0 100644
--- a/tests/test_gsxws.py
+++ b/tests/test_gsxws.py
@@ -104,10 +104,10 @@ class RepairTestCase(RemoteTestCase):
_comptia.comptiaCode = ccode
self.comptia = _comptia
- r = repairs.SymptomIssue(serialNumber=self.sn).fetch()
- self.symptom = r.symptoms[0].reportedSymptomCode
- r = repairs.SymptomIssue(reportedSymptomCode=self.symptom).fetch()
- self.issue = r.issues[0].reportedIssueCode
+ self._symptoms = repairs.SymptomIssue(serialNumber=self.sn).fetch()
+ self.symptom = self._symptoms[0][0]
+ self._issues = repairs.SymptomIssue(reportedSymptomCode=self.symptom).fetch()
+ self.issue = self._issues[0][0]
class TestCoreFunctions(TestCase):
@@ -210,10 +210,11 @@ class TestEscalationFunctions(RemoteTestCase):
class TestRepairFunctions(RepairTestCase):
- def test_symptom_issue(self):
- from gsxws.repairs import SymptomIssue
- r = SymptomIssue(serialNumber=env['GSX_SN']).fetch()
- self.assertEqual(r.symptoms[0].reportedSymptomCode, 6115)
+ def test_symptom_code(self):
+ self.assertEqual(self._symptoms[0][0], 'PD17A')
+
+ def test_issue_code(self):
+ self.assertEqual(self._issues[0][0], 'PD17-01')
def test_create_carryin(self):
rep = repairs.CarryInRepair()