From 6a561fae92560b299199a4b4f78feba507071b10 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 6 Oct 2014 23:41:08 +0300 Subject: Added iOS diags fetch test --- tests/test_gsxws.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') 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() -- cgit v1.2.3