aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-10-09 11:00:24 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-10-09 11:00:24 +0300
commit3420f74425c8e8247bef4a916bc053f1ed95df07 (patch)
tree0d5e61da7ae627748ed74990ba4b462cf6bf42b9
parentd278969719a9fd089fe39eb74c31fcfe1ddac4fd (diff)
downloadpy-gsxws-3420f74425c8e8247bef4a916bc053f1ed95df07.tar.gz
py-gsxws-3420f74425c8e8247bef4a916bc053f1ed95df07.tar.bz2
py-gsxws-3420f74425c8e8247bef4a916bc053f1ed95df07.zip
Fix diags.run_test
-rw-r--r--gsxws/core.py4
-rw-r--r--gsxws/diagnostics.py2
-rw-r--r--tests/test_gsxws.py9
3 files changed, 12 insertions, 3 deletions
diff --git a/gsxws/core.py b/gsxws/core.py
index 4c3c4a4..083efed 100644
--- a/gsxws/core.py
+++ b/gsxws/core.py
@@ -324,6 +324,10 @@ class GsxRequest(object):
# @hack FetchDiagnosticSuites doesn't follow the naming conventions
if method.endswith('FetchDiagnosticSuites'):
request_name = 'FetchDiagnosticSuitesRequestData'
+
+ # @hack RunDiagnosticTest doesn't follow the naming conventions
+ if method.endswith('RunDiagnosticTest'):
+ request_name = 'RunDiagnosticTestRequestData'
request = ET.SubElement(root, request_name)
request.append(GSX_SESSION)
diff --git a/gsxws/diagnostics.py b/gsxws/diagnostics.py
index 79a7975..f1815e7 100644
--- a/gsxws/diagnostics.py
+++ b/gsxws/diagnostics.py
@@ -65,7 +65,7 @@ class Diagnostics(GsxObject):
"diagnosticEventNumbers")
return self._req.objects
- def run(self):
+ def run_test(self):
"""
The Run Diagnostic Test API allows users to run a specific or
all the diagnostic tests on a device.
diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py
index 22372ab..2239419 100644
--- a/tests/test_gsxws.py
+++ b/tests/test_gsxws.py
@@ -52,6 +52,8 @@ class DiagnosticsTestCase(TestCase):
device = Product(sn=self.sn)
self.diag = diagnostics.Diagnostics(serialNumber=self.sn)
self.diag.shipTo = os.getenv('GSX_SHIPTO')
+ suites = self.diag.fetch_suites()
+ self.suite = suites[0]
def test_fetch(self):
res = self.diag.fetch()
@@ -68,8 +70,11 @@ class DiagnosticsTestCase(TestCase):
self.assertUnicodeOrInt(r.value)
def test_fetch_suites(self):
- suites = self.diag.fetch_suites()
- self.assertIsInstance(suites[0][0], int)
+ self.assertIsInstance(self.suite[0], int)
+
+ def test_run_test(self):
+ self.diag.diagnosticSuiteId = self.suite[0]
+ self.diag.run_test()
def test_fetch_dc_url(self):
url = self.diag.fetch_dc_url()