Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:dirkmueller:acdc:as_python3_module
python-Twisted.31483
support-new-glibc.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File support-new-glibc.patch of Package python-Twisted.31483
From da3bf3dc29f067e7019b2a1c205834ab64b2139a Mon Sep 17 00:00:00 2001 From: Paul Eggert <eggert@cs.ucla.edu> Date: Fri, 9 Dec 2022 10:16:42 -0800 Subject: [PATCH] #11786 fix misuse of mktime in tests --- src/twisted/logger/test/test_format.py | 27 +++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/twisted/logger/test/test_format.py b/src/twisted/logger/test/test_format.py index dbfbe1af1ae..0671b6662c8 100644 --- a/src/twisted/logger/test/test_format.py +++ b/src/twisted/logger/test/test_format.py @@ -166,16 +166,17 @@ def test_formatTimeWithDefaultFormat(self) -> None: def testForTimeZone(name: str, expectedDST: str, expectedSTD: str) -> None: setTZ(name) - localDST = mktime((2006, 6, 30, 0, 0, 0, 4, 181, 1)) localSTD = mktime((2007, 1, 31, 0, 0, 0, 2, 31, 0)) - - self.assertEqual(formatTime(localDST), expectedDST) self.assertEqual(formatTime(localSTD), expectedSTD) + if expectedDST: + localDST = mktime((2006, 6, 30, 0, 0, 0, 4, 181, 1)) + self.assertEqual(formatTime(localDST), expectedDST) + # UTC testForTimeZone( "UTC+00", - "2006-06-30T00:00:00+0000", + None, "2007-01-31T00:00:00+0000", ) @@ -196,7 +197,7 @@ def testForTimeZone(name: str, expectedDST: str, expectedSTD: str) -> None: # No DST testForTimeZone( "CST+06", - "2006-06-30T00:00:00-0600", + None, "2007-01-31T00:00:00-0600", ) @@ -211,7 +212,7 @@ def test_formatTimeWithNoFormat(self) -> None: """ If C{timeFormat} argument is L{None}, we get the default output. """ - t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1)) + t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1)) self.assertEqual(formatTime(t, timeFormat=None), "-") self.assertEqual(formatTime(t, timeFormat=None, default="!"), "!") @@ -219,7 +220,7 @@ def test_formatTimeWithAlternateTimeFormat(self) -> None: """ Alternate time format in output. """ - t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1)) + t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1)) self.assertEqual(formatTime(t, timeFormat="%Y/%W"), "2013/38") def test_formatTimePercentF(self) -> None: @@ -246,7 +247,7 @@ def test_formatTimeDefault(self) -> None: addTZCleanup(self) setTZ("UTC+00") - t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1)) + t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1)) event = dict(log_format="XYZZY", log_time=t) self.assertEqual( formatEventAsClassicLogText(event), @@ -539,7 +540,7 @@ def test_eventAsTextSystemOnly(self) -> None: except CapturedError: f = Failure() - t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1)) + t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1)) event: LogEvent = { "log_format": "ABCD", "log_system": "fake_system", @@ -573,7 +574,7 @@ def test_eventAsTextTimestampOnly(self) -> None: except CapturedError: f = Failure() - t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1)) + t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1)) event: LogEvent = { "log_format": "ABCD", "log_system": "fake_system", @@ -601,7 +602,7 @@ def test_eventAsTextSystemMissing(self) -> None: except CapturedError: f = Failure() - t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1)) + t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1)) event: LogEvent = { "log_format": "ABCD", "log_time": t, @@ -628,7 +629,7 @@ def test_eventAsTextSystemMissingNamespaceAndLevel(self) -> None: except CapturedError: f = Failure() - t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1)) + t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1)) event: LogEvent = { "log_format": "ABCD", "log_time": t, @@ -657,7 +658,7 @@ def test_eventAsTextSystemMissingLevelOnly(self) -> None: except CapturedError: f = Failure() - t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, 1)) + t = mktime((2013, 9, 24, 11, 40, 47, 1, 267, -1)) event: LogEvent = { "log_format": "ABCD", "log_time": t,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor