diff options
author | Filipp Lepalaan <filipp@mac.com> | 2016-03-21 18:04:13 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2016-03-21 18:04:13 +0200 |
commit | c150e100f9a6cc3ba2168574afe74134009382a0 (patch) | |
tree | 96e3e6c7e648596a9c1bf1f2943a29d0da135540 /tests | |
parent | cc38b441e308b709d6ee118d8f4d5aa50a7d05ed (diff) | |
parent | 5d5a8eae87bc7249ab01a63fadfd87f5e0739fe0 (diff) | |
download | py-gsxws-c150e100f9a6cc3ba2168574afe74134009382a0.tar.gz py-gsxws-c150e100f9a6cc3ba2168574afe74134009382a0.tar.bz2 py-gsxws-c150e100f9a6cc3ba2168574afe74134009382a0.zip |
Merge branch 'devel'
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_gsxws.py | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py index c4924da..164c90c 100644 --- a/tests/test_gsxws.py +++ b/tests/test_gsxws.py @@ -10,13 +10,39 @@ from gsxws.core import validate from gsxws.objectify import parse, gsx_diags_timestamp from gsxws.products import Product from gsxws import (repairs, escalations, lookups, returns, - GsxError, ServicePart, diagnostics, comptia,) + GsxError, ServicePart, diagnostics, comptia, + comms,) def empty(a): return a in [None, '', ' '] +class CommsTestCase(TestCase): + def setUp(self): + from gsxws.core import connect + self.priority = 'HIGH' + self.article_id = 'SN3133' + connect(os.getenv('GSX_USER'), os.getenv('GSX_SOLDTO'), os.getenv('GSX_ENV')) + self.articles = comms.fetch(priority=self.priority, readStatus=False) + + def test_priority(self): + for a in self.articles: + self.assertEqual(a.priority, self.priority) + + def test_date(self): + for a in self.articles: + self.assertIsInstance(a.createdDate, date) + + def test_content(self): + content = comms.content(self.article_id) + self.assertEqual(content.languageCode, 'en') + + def test_ack(self): + result = comms.ack(self.article_id, 'UNREAD') + self.assertEqual(result.acknowledgeType, 'UNREAD') + + class RemoteTestCase(TestCase): def setUp(self): from gsxws.core import connect @@ -177,9 +203,9 @@ class TestErrorFunctions(TestCase): from gsxws.core import GsxResponse xml = open('tests/fixtures/error_ca_fmip.xml', 'r').read() with self.assertRaisesRegexp(GsxError, 'A repair cannot be created'): - GsxResponse(xml=xml, el_method='CreateCarryInResponse', + GsxResponse(xml=xml, el_method='CreateCarryInResponse', el_response='repairConfirmation') - + class TestLookupFunctions(RemoteTestCase): def test_component_check(self): |