aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2014-10-06 23:41:08 +0300
committerFilipp Lepalaan <filipp@mac.com>2014-10-06 23:41:08 +0300
commit6a561fae92560b299199a4b4f78feba507071b10 (patch)
treea8135437753bbbdb8b628db63015a0d130ec5bce
parent05a84ba0eb1781665bbb5eaeb1ecd4be0fb46408 (diff)
downloadpy-gsxws-6a561fae92560b299199a4b4f78feba507071b10.tar.gz
py-gsxws-6a561fae92560b299199a4b4f78feba507071b10.tar.bz2
py-gsxws-6a561fae92560b299199a4b4f78feba507071b10.zip
Added iOS diags fetch test
-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()