aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/test_gsxws.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py
index a4f1a21..0363fc9 100644
--- a/tests/test_gsxws.py
+++ b/tests/test_gsxws.py
@@ -20,6 +20,11 @@ class RemoteTestCase(TestCase):
env['GSX_SOLDTO'],
env['GSX_ENV'])
+ def assertUnicodeOrInt(self, val):
+ try:
+ self.assertIsInstance(val, unicode)
+ except AssertionError:
+ self.assertIsInstance(val, int)
class DiagnosticsTestCase(RemoteTestCase):
def setUp(self):
@@ -27,6 +32,21 @@ class DiagnosticsTestCase(RemoteTestCase):
self.diag = diagnostics.Diagnostics(serialNumber=env['GSX_SN'])
self.diag.shipTo = env['GSX_SHIPTO']
+ def test_fetch_ios(self):
+ self.diag = diagnostics.Diagnostics(alternateDeviceId=env['GSX_SN'])
+ res = self.diag.fetch()
+
+ for r in res.diagnosticTestData.testResult.result:
+ self.assertIsInstance(r.name, unicode)
+ self.assertUnicodeOrInt(r.value)
+
+ for r in res.diagnosticProfileData.profile.unit.key:
+ self.assertIsInstance(r.name, unicode)
+ self.assertUnicodeOrInt(r.value)
+
+ for r in res.diagnosticProfileData.report.reportData.key:
+ self.assertUnicodeOrInt(r.value)
+
def test_initiate_email(self):
self.diag.emailAddress = env['GSX_EMAIL']
res = self.diag.initiate()