aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2014-05-13 23:00:58 +0300
committerFilipp Lepalaan <filipp@mac.com>2014-05-13 23:00:58 +0300
commit5652c5955593b1118f8b3d496c84fba4f164129c (patch)
treef04b4bf171da98209ebb332c51cf9d845b4a28f0 /tests
parentd6473bcbede636e8ba553fe6c4df8cd796d0797a (diff)
downloadpy-gsxws-5652c5955593b1118f8b3d496c84fba4f164129c.tar.gz
py-gsxws-5652c5955593b1118f8b3d496c84fba4f164129c.tar.bz2
py-gsxws-5652c5955593b1118f8b3d496c84fba4f164129c.zip
Added some iOS diags tests
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/ios_diagnostics.xml240
-rw-r--r--tests/test_gsxws.py34
2 files changed, 273 insertions, 1 deletions
diff --git a/tests/fixtures/ios_diagnostics.xml b/tests/fixtures/ios_diagnostics.xml
new file mode 100644
index 0000000..0a67091
--- /dev/null
+++ b/tests/fixtures/ios_diagnostics.xml
@@ -0,0 +1,240 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
+ <S:Body>
+ <ns4:FetchIOSDiagnosticResponse xmlns:ns2="http://asp.core.endpoint.ws.gsx.ist.apple.com/" xmlns:ns3="http://gsxws.apple.com/elements/core/asp" xmlns:ns4="http://gsxws.apple.com/elements/global" xmlns:ns5="http://gsxws.apple.com/elements/core/asp/emea" xmlns:ns6="http://gsxws.apple.com/elements/core">
+ <FetchIOSDiagnosticResponse>
+ <operationID>4fmhx3nKL7MAnvoq6SGM0Bc</operationID>
+ <lookupResponseData>
+ <diagnosticTestData>
+ <testContext>
+ <serialNumber>XXXXXXXXXXXX</serialNumber>
+ <captureId>64419571</captureId>
+ <diagnosticTimeStamp>13-May-14 18:34:52</diagnosticTimeStamp>
+ <channelID>GSX</channelID>
+ <diagnosticValidationResult>0</diagnosticValidationResult>
+ <validationCode>R3.001</validationCode>
+ <diagnosticEventNumber>36558205</diagnosticEventNumber>
+ </testContext>
+ <testResult>
+ <result>
+ <name>BATTERY_HEALTH</name>
+ <value>1</value>
+ <information>GREEN</information>
+ </result>
+ <result>
+ <name>FULLY_CHARGED</name>
+ <value>1</value>
+ <information/>
+ </result>
+ <result>
+ <name>LATEST_IOS_VERSION</name>
+ <value>1</value>
+ <information/>
+ </result>
+ <result>
+ <name>UNCLEAN_SHUTDOWN_TEST</name>
+ <value>1</value>
+ <information/>
+ </result>
+ </testResult>
+ </diagnosticTestData>
+ <diagnosticProfileData>
+ <profile>
+ <unit>
+ <key>
+ <name>SERIAL_NUM</name>
+ <value>XXXXXXXXXXXX</value>
+ </key>
+ <key>
+ <name>DEVICE_NAME</name>
+ <value>fliPhone</value>
+ </key>
+ <key>
+ <name>HARDWARE_MODEL</name>
+ <value>iPhone5,2</value>
+ </key>
+ <key>
+ <name>CURR_IOS_VERSION</name>
+ <value>7001001</value>
+ </key>
+ <key>
+ <name>RESTORE_DATE</name>
+ <value>03-Apr-14 08:54:27</value>
+ </key>
+ <key>
+ <name>LATEST_IOS_VERSION_AVAILABLE</name>
+ <value>7001001</value>
+ </key>
+ </unit>
+ <module/>
+ </profile>
+ <report>
+ <reportData>
+ <key>
+ <name>LAST_USAGE_LENGTH</name>
+ <value>44863</value>
+ </key>
+ <key>
+ <name>LAST_STANDBY_LENGTH</name>
+ <value>85031</value>
+ </key>
+ <key>
+ <name>LAST_USAGE_BATTERY_LEVEL</name>
+ <value>83</value>
+ </key>
+ <key>
+ <name>LONGEST_STANDBY_LENGTH</name>
+ <value>312426</value>
+ </key>
+ <key>
+ <name>LONGEST_STANDBY_DATE</name>
+ <value>03-May-14 09:07:41</value>
+ </key>
+ <key>
+ <name>LONGEST_STANDBY_BATTERY_LEVEL</name>
+ <value>8</value>
+ </key>
+ <key>
+ <name>PLUGGED_IN_AFTER_LAST_USAGE</name>
+ <value>0</value>
+ </key>
+ <key>
+ <name>LONGEST_USAGE_LENGTH</name>
+ <value>16378</value>
+ </key>
+ <key>
+ <name>LONGEST_USAGE_DATE</name>
+ <value>03-May-14 09:07:41</value>
+ </key>
+ <key>
+ <name>LONGEST_USAGE_BATTERY_LEVEL</name>
+ <value>8</value>
+ </key>
+ </reportData>
+ <reportData>
+ <key>
+ <name>HIGH_TEMP</name>
+ <value>0.0</value>
+ </key>
+ <key>
+ <name>NUM_TEMP_WARN</name>
+ <value>0</value>
+ </key>
+ <key>
+ <name>TOTAL_TIME_WARN</name>
+ <value>0</value>
+ </key>
+ <key>
+ <name>HIGH_TEMP_RESPONSE_CODE</name>
+ <value>0</value>
+ </key>
+ </reportData>
+ <reportData>
+ <key>
+ <name>FREQ_APP_CRASH</name>
+ <value>BitTorrent Sync,CommCenterMobileHelper</value>
+ </key>
+ <key>
+ <name>APP_CRASH_RESPONSE_CODE</name>
+ <value>1</value>
+ </key>
+ </reportData>
+ <reportData>
+ <key>
+ <name>OUT_OF_MEMORY</name>
+ <value/>
+ </key>
+ <key>
+ <name>MOST_OUT_OF_MEMORY_APP</name>
+ <value/>
+ </key>
+ <key>
+ <name>MEMORY_RESPONSE_CODE</name>
+ <value>0</value>
+ </key>
+ </reportData>
+ <reportData>
+ <key>
+ <name>FREQ_APP_HANG</name>
+ <value/>
+ </key>
+ <key>
+ <name>APP_HANG_COUNT</name>
+ <value>0</value>
+ </key>
+ <key>
+ <name>APP_HANG_RESPONSE_CODE</name>
+ <value>0</value>
+ </key>
+ </reportData>
+ <reportData>
+ <key>
+ <name>UNCLEAN_SHUTDOWN_COUNT</name>
+ <value>0</value>
+ </key>
+ <key>
+ <name>SPRINGBOARD_UNRESPONSIVE_COUNT</name>
+ <value>0</value>
+ </key>
+ </reportData>
+ <reportData>
+ <key>
+ <name>THIRD_PARTY_APP_TEST</name>
+ <value/>
+ </key>
+ <key>
+ <name>THIRD_PARTY_APP_RESPONSE_CODE</name>
+ <value>0</value>
+ </key>
+ </reportData>
+ <reportData>
+ <key>
+ <name>CURR_BATTERY_LEVEL</name>
+ <value>83</value>
+ </key>
+ </reportData>
+ <reportData/>
+ <reportData/>
+ </report>
+ </diagnosticProfileData>
+ <diagnosis>
+ <issueType>BATTERY_HEALTH</issueType>
+ <helpDocText>Troubleshooting iPhone Lithium-Ion Batteries</helpDocText>
+ <articleLink>http://www.apple.com/batteries/iphone.html</articleLink>
+ </diagnosis>
+ <diagnosis>
+ <issueType>UNCLEAN_SHUTDOWN_TEST</issueType>
+ <helpDocText>Turning off and on (restarting) and resetting.</helpDocText>
+ <articleLink>http://support.apple.com/kb/HT1430</articleLink>
+ </diagnosis>
+ <diagnosis>
+ <issueType>HIGH_TEMP_RESPONSE_CODE</issueType>
+ <helpDocText>Keeping device within acceptable operating temperatures.</helpDocText>
+ <articleLink>http://support.apple.com/kb/HT2101</articleLink>
+ </diagnosis>
+ <diagnosis>
+ <issueType>APP_CRASH_RESPONSE_CODE</issueType>
+ <helpDocText>iOS: Troubleshooting applications purchased from the App Store. Ensure all 3rd Party Apps are updated to the latest version.</helpDocText>
+ <articleLink>http://support.apple.com/kb/TS1702</articleLink>
+ </diagnosis>
+ <diagnosis>
+ <issueType>APP_HANG_RESPONSE_CODE</issueType>
+ <helpDocText>Understanding multitasking.</helpDocText>
+ <articleLink>http://support.apple.com/kb/HT4211</articleLink>
+ </diagnosis>
+ <diagnosis>
+ <issueType>THIRD_PARTY_APP_RESPONSE_CODE</issueType>
+ <helpDocText>iOS: Troubleshooting applications purchased from the App Store.</helpDocText>
+ <articleLink>http://support.apple.com/kb/TS1702</articleLink>
+ </diagnosis>
+ <diagnosis>
+ <issueType>MEMORY_RESPONSE_CODE</issueType>
+ <helpDocText>iOS: Troubleshooting applications purchased from the App Store.</helpDocText>
+ <articleLink>http://support.apple.com/kb/TS1702</articleLink>
+ </diagnosis>
+ </lookupResponseData>
+ <communicationMessage>There are high priority communications pending for you</communicationMessage>
+ </FetchIOSDiagnosticResponse>
+ </ns4:FetchIOSDiagnosticResponse>
+ </S:Body>
+</S:Envelope> \ No newline at end of file
diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py
index 8ce6328..8f11633 100644
--- a/tests/test_gsxws.py
+++ b/tests/test_gsxws.py
@@ -212,7 +212,7 @@ class TestWarrantyFunctions(TestCase):
self.assertTrue(self.data.partCovered)
-class TestDiagnostics(RemoteTestCase):
+class TestRepairDiagnostics(RemoteTestCase):
def setUp(self):
super(TestDiagnostics, self).setUp()
self.results = diagnostics.Diagnostics(serialNumber=env['GSX_SN']).fetch()
@@ -224,6 +224,38 @@ class TestDiagnostics(RemoteTestCase):
ts = gsx_diags_timestamp(self.results.eventHeader.startTimeStamp)
self.assertIsInstance(ts, datetime)
+
+class TestIosDiagnostics(TestCase):
+ def setUp(self):
+ self.data = parse('tests/fixtures/ios_diagnostics.xml',
+ 'lookupResponseData')
+
+ def test_sn(self):
+ self.assertEqual(self.data.diagnosticTestData.testContext.serialNumber,
+ "XXXXXXXXXXXX")
+
+ def test_result(self):
+ data = self.data.diagnosticTestData.testResult
+ for i in data.result:
+ logging.debug("%s: %s" % (i.name, i.value))
+
+ self.assertEqual(data.result[1].name, "FULLY_CHARGED")
+
+ def test_profile(self):
+ data = self.data.diagnosticProfileData.profile
+ for i in data.unit.key:
+ logging.debug("%s: %s" % (i.name, i.value))
+
+ self.assertEqual(data.unit.key[1].value, "fliPhone")
+
+ def test_report(self):
+ data = self.data.diagnosticProfileData.report
+ for i in data.reportData.key:
+ logging.debug("%s: %s" % (i.name, i.value))
+
+ self.assertEqual(data.reportData.key[0].name, "LAST_USAGE_LENGTH")
+
+
class TestOnsiteCoverage(RemoteTestCase):
def setUp(self):
super(TestOnsiteCoverage, self).setUp()