diff options
author | Rob Crittenden <rcritten@redhat.com> | 2011-01-24 10:43:59 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-01-24 14:34:38 -0500 |
commit | 96469fbc886bb53a898396ad030a48609f147160 (patch) | |
tree | 028670e416aa7671e242e01b6fcfdef72b525be6 /ipapython | |
parent | 6e7729726f6e87dc117d284719d3f68833056a28 (diff) | |
download | freeipa-96469fbc886bb53a898396ad030a48609f147160.tar.gz freeipa-96469fbc886bb53a898396ad030a48609f147160.tar.xz freeipa-96469fbc886bb53a898396ad030a48609f147160.zip |
Fix failed tests. API for utcoffset changed and strings are more robust.
In Python 2.7 the API for time.utcoffset() changed.
We do more automatic conversions of strings so need to loosen the tests
a bit.
Diffstat (limited to 'ipapython')
-rw-r--r-- | ipapython/test/test_ipautil.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ipapython/test/test_ipautil.py b/ipapython/test/test_ipautil.py index ef1afd3c..ff9f2823 100644 --- a/ipapython/test/test_ipautil.py +++ b/ipapython/test/test_ipautil.py @@ -275,7 +275,7 @@ class TestTimeParser(unittest.TestCase): time = ipautil.parse_generalized_time(timestr) self.assertEqual(0, time.tzinfo.houroffset) self.assertEqual(0, time.tzinfo.minoffset) - offset = time.tzinfo.utcoffset() + offset = time.tzinfo.utcoffset(time.tzinfo.dst()) self.assertEqual(0, offset.seconds) timestr = "20051213141205+0500" @@ -283,7 +283,7 @@ class TestTimeParser(unittest.TestCase): time = ipautil.parse_generalized_time(timestr) self.assertEqual(5, time.tzinfo.houroffset) self.assertEqual(0, time.tzinfo.minoffset) - offset = time.tzinfo.utcoffset() + offset = time.tzinfo.utcoffset(time.tzinfo.dst()) self.assertEqual(5 * 60 * 60, offset.seconds) timestr = "20051213141205-0500" @@ -293,7 +293,7 @@ class TestTimeParser(unittest.TestCase): self.assertEqual(0, time.tzinfo.minoffset) # NOTE - the offset is always positive - it's minutes # _east_ of UTC - offset = time.tzinfo.utcoffset() + offset = time.tzinfo.utcoffset(time.tzinfo.dst()) self.assertEqual((24 - 5) * 60 * 60, offset.seconds) timestr = "20051213141205-0930" @@ -301,7 +301,7 @@ class TestTimeParser(unittest.TestCase): time = ipautil.parse_generalized_time(timestr) self.assertEqual(-9, time.tzinfo.houroffset) self.assertEqual(-30, time.tzinfo.minoffset) - offset = time.tzinfo.utcoffset() + offset = time.tzinfo.utcoffset(time.tzinfo.dst()) self.assertEqual(((24 - 9) * 60 * 60) - (30 * 60), offset.seconds) |