Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7edd71a9
Commit
7edd71a9
authored
Nov 09, 2001
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_formatdate(): Don't do the localtime test if we don't have
strptime() -- I'm too lazy to code it otherwise.
parent
11448670
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
Lib/test/test_email.py
Lib/test/test_email.py
+12
-10
No files found.
Lib/test/test_email.py
View file @
7edd71a9
...
...
@@ -924,16 +924,18 @@ class TestMiscellaneous(unittest.TestCase):
gdate
=
Utils
.
formatdate
(
now
)
ldate
=
Utils
.
formatdate
(
now
,
localtime
=
1
)
self
.
assertEqual
(
gdate
,
'Fri, 09 Nov 2001 17:33:52 -0000'
)
# It's a little tougher to test for localtime, but we'll try
gtime
=
time
.
strptime
(
gdate
.
split
()[
4
],
'%H:%M:%S'
)
ltime
=
time
.
strptime
(
ldate
.
split
()[
4
],
'%H:%M:%S'
)
zone
=
ldate
.
split
()[
5
]
offset
=
int
(
zone
[:
3
])
*
-
3600
+
int
(
zone
[
-
2
:])
if
time
.
daylight
and
time
.
localtime
(
now
)[
-
1
]:
toff
=
time
.
altzone
else
:
toff
=
time
.
timezone
self
.
assertEqual
(
offset
,
toff
)
# It's a little tougher to test for localtime, but we'll try. Skip if
# we don't have strptime().
if
hasattr
(
time
,
'striptime'
):
gtime
=
time
.
strptime
(
gdate
.
split
()[
4
],
'%H:%M:%S'
)
ltime
=
time
.
strptime
(
ldate
.
split
()[
4
],
'%H:%M:%S'
)
zone
=
ldate
.
split
()[
5
]
offset
=
int
(
zone
[:
3
])
*
-
3600
+
int
(
zone
[
-
2
:])
if
time
.
daylight
and
time
.
localtime
(
now
)[
-
1
]:
toff
=
time
.
altzone
else
:
toff
=
time
.
timezone
self
.
assertEqual
(
offset
,
toff
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment