diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixtures/escalation_details_lookup.xml | 29 | ||||
-rw-r--r-- | tests/test_gsxws.py | 21 |
2 files changed, 49 insertions, 1 deletions
diff --git a/tests/fixtures/escalation_details_lookup.xml b/tests/fixtures/escalation_details_lookup.xml new file mode 100644 index 0000000..6aa9335 --- /dev/null +++ b/tests/fixtures/escalation_details_lookup.xml @@ -0,0 +1,29 @@ +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Body> + <ns3:GeneralEscalationDetailsLookupResponse 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"> + <GeneralEscalationDetailsLookupResponse> + <operationId>4ClHBDHhOL0NWdQMp4XBB</operationId> + <lookupResponseData> + <escalationId>2392767</escalationId> + <escalationType>GSX Help</escalationType> + <escalationStatus>O</escalationStatus> + <issueType>GSX Usage Question</issueType> + <escalationTo>Apple</escalationTo> + <createdBy>filipp Lepalaan</createdBy> + <createTimestamp>03/06/14 09:01 PM</createTimestamp> + <lastViewedBy>filipp Lepalaan</lastViewedBy> + <lastViewedTimestamp>03/06/14 09:06 PM</lastViewedTimestamp> + <lastModifiedBy>filipp Lepalaan</lastModifiedBy> + <lastModifiedTimestamp>03/06/14 09:02 PM</lastModifiedTimestamp> + <escalationAge>4 minutes </escalationAge> + <escalationNotes> + <note>blaa</note> + <note>test +</note> + </escalationNotes> + </lookupResponseData> + </GeneralEscalationDetailsLookupResponse> + </ns3:GeneralEscalationDetailsLookupResponse> + </S:Body> +</S:Envelope>
\ No newline at end of file diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py index 3cb1e06..5571c22 100644 --- a/tests/test_gsxws.py +++ b/tests/test_gsxws.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- import logging -from datetime import date from os import environ as env +from datetime import date, datetime from unittest import main, skip, TestCase @@ -29,6 +29,24 @@ class TestCoreFunctions(TestCase): self.assertRegexpMatches(rep.dumps(), '<GsxObject><blaa>ääöö</blaa><orderLines>') +class TestTypes(TestCase): + def setUp(self): + xml = open('tests/fixtures/escalation_details_lookup.xml', 'r').read() + self.data = parse(xml, 'lookupResponseData') + + def test_unicode(self): + self.assertIsInstance(self.data.lastModifiedBy, unicode) + + def test_timestamp(self): + self.assertIsInstance(self.data.createTimestamp, datetime) + + def test_ts_comp(self): + self.assertGreater(datetime.now(), self.data.createTimestamp) + + def test_list(self): + self.assertIsInstance(self.data.escalationNotes, list) + + class TestErrorFunctions(TestCase): def setUp(self): xml = open('tests/fixtures/multierror.xml', 'r').read() @@ -251,6 +269,7 @@ class TestRepairUpdate(RemoteTestCase): result = self.repair.set_techid('XXXXX') self.assertEqual(result.confirmationNumber, self.dispatchId) + class TestCarryinRepairDetail(TestCase): def setUp(self): self.data = parse('tests/fixtures/repair_details_ca.xml', |