diff options
Diffstat (limited to 'tests/test_gsxws.py')
-rw-r--r-- | tests/test_gsxws.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py index 1de1906..dc0f4aa 100644 --- a/tests/test_gsxws.py +++ b/tests/test_gsxws.py @@ -9,7 +9,7 @@ from unittest import main, skip, TestCase from gsxws.objectify import parse, gsx_diags_timestamp from gsxws.products import Product from gsxws import (repairs, escalations, lookups, - GsxError, ServicePart, diagnostics) + GsxError, ServicePart, diagnostics,) class RemoteTestCase(TestCase): @@ -21,6 +21,23 @@ class RemoteTestCase(TestCase): env['GSX_ENV']) +class DiagnosticsTestCase(RemoteTestCase): + def setUp(self): + super(DiagnosticsTestCase, self).setUp() + self.diag = diagnostics.Diagnostics(serialNumber=env['GSX_SN']) + self.diag.shipTo = env['GSX_SHIPTO'] + + def test_initiate_email(self): + self.diag.emailAddress = env['GSX_EMAIL'] + res = self.diag.initiate() + self.assertRegexpMatches(str(res), r'\d+') + + def test_initiate_phone(self): + self.diag.phoneNumber = env['GSX_PHONE'] + with self.assertRaisesRegexp(GsxError, 'SMS sending is not supported'): + self.diag.initiate() + + class RepairTestCase(RemoteTestCase): def setUp(self): super(RepairTestCase, self).setUp() |