aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_gsxws.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2014-03-07 11:16:21 +0200
committerFilipp Lepalaan <filipp@mac.com>2014-03-07 11:16:21 +0200
commit79e4628a53f1cac06f6426b301dafa1351412702 (patch)
treeae04368811a29f30b1d8b9298abcfcd2cd471fbf /tests/test_gsxws.py
parent187735f29c43e5356b8d153f7db82e05d2440d60 (diff)
downloadpy-gsxws-79e4628a53f1cac06f6426b301dafa1351412702.tar.gz
py-gsxws-79e4628a53f1cac06f6426b301dafa1351412702.tar.bz2
py-gsxws-79e4628a53f1cac06f6426b301dafa1351412702.zip
Added timestamp datatype, more tests
Diffstat (limited to 'tests/test_gsxws.py')
-rw-r--r--tests/test_gsxws.py21
1 files changed, 20 insertions, 1 deletions
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',