diff options
author | Filipp Lepalaan <f@230.to> | 2013-09-23 17:35:54 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-09-23 17:35:54 +0300 |
commit | 86a6df80b0e40855097fcf836cf11bd4808882f6 (patch) | |
tree | 9bc6c3c4766e7ae5a21403c01f317b2a0b34b1c7 /tests/test_gsxws.py | |
parent | d78047ab44809537d21fe048d63a4c3c8e96df3d (diff) | |
download | py-gsxws-86a6df80b0e40855097fcf836cf11bd4808882f6.tar.gz py-gsxws-86a6df80b0e40855097fcf836cf11bd4808882f6.tar.bz2 py-gsxws-86a6df80b0e40855097fcf836cf11bd4808882f6.zip |
Added support for multiple error messages
Diffstat (limited to 'tests/test_gsxws.py')
-rw-r--r-- | tests/test_gsxws.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py index 6146a2c..59c0662 100644 --- a/tests/test_gsxws.py +++ b/tests/test_gsxws.py @@ -8,14 +8,29 @@ from unittest import main, skip, TestCase from gsxws.objectify import parse from gsxws.products import Product -from gsxws import repairs, escalations +from gsxws import repairs, escalations, GsxError class RemoteTestCase(TestCase): def setUp(self): from gsxws.core import connect logging.basicConfig(level=logging.DEBUG) - connect(env['GSX_USER'], env['GSX_PASSWORD'], env['GSX_SOLDTO'], env['GSX_ENV']) + connect(env['GSX_USER'], + env['GSX_PASSWORD'], + env['GSX_SOLDTO'], + env['GSX_ENV']) + + +class TestErrorFunctions(TestCase): + def setUp(self): + xml = open('tests/fixtures/multierror.xml', 'r').read() + self.data = GsxError(xml=xml) + + def test_code(self): + self.assertEqual(self.data.errors['RPR.ONS.025'], + 'This unit is not eligible for an Onsite repair from GSX.') + def test_message(self): + self.assertRegexpMatches(self.data.message, 'Multiple error messages exist.') class TestEscalationFunctions(RemoteTestCase): |