Skip to content
This repository has been archived by the owner on Feb 17, 2018. It is now read-only.

Commit

Permalink
Added test case for small year from bugreport
Browse files Browse the repository at this point in the history
git-svn-id: https://pywebsvcs.svn.sourceforge.net/svnroot/pywebsvcs/trunk@1480 7150bf37-e60d-0410-b93f-83e91ef0e581
  • Loading branch information
psha committed Jan 7, 2009
1 parent c45435f commit 40e2a40
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions zsi/test/test_TCtimes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
# vim: sts=4 sw=4 et

import unittest, sys, tests_good, tests_bad, time, os
from ZSI import *
try:
Expand All @@ -15,6 +17,7 @@ class TestCase(unittest.TestCase):
def _check_data2data(self, tc, data, correct, msg):
tmp = tc.text_to_data(data, None, None)
stamp = tc.get_formatted_content(tmp)
#print "%s -> %s" % (data, str(tmp))

self.failUnless(stamp == correct,
'%s with local offset(%s): expecting "%s" got "%s"' %(
Expand All @@ -31,6 +34,12 @@ def _wrap_timezone(self, f, *a, **kw):
os.environ['TZ'] = oldtz
time.tzset()

def _check_minimum(self):
data = "0001-01-01T00:00:00.0000000-07:00"
tc = TC.gDateTime()
tc.text_to_data(data, None, None)
check_minimum = lambda s: s._wrap_timezone(s._check_minimum)

def _check_datetime_timezone(self):
# UTC with local timezone offset
# Base example from http://www.w3.org/TR/xmlschema11-2/#dateTime-lexical-mapping
Expand Down

0 comments on commit 40e2a40

Please sign in to comment.