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
392a088f
Commit
392a088f
authored
Aug 10, 2013
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#18453: fix unused variables in test_xmlrpc. Patch by Vajrasky Kok.
parent
98152031
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
Lib/test/test_xmlrpc.py
Lib/test/test_xmlrpc.py
+10
-2
No files found.
Lib/test/test_xmlrpc.py
View file @
392a088f
...
...
@@ -3,6 +3,7 @@ import datetime
import
sys
import
time
import
unittest
from
unittest
import
mock
import
xmlrpc.client
as
xmlrpclib
import
xmlrpc.server
import
http.client
...
...
@@ -249,7 +250,14 @@ class FaultTestCase(unittest.TestCase):
class
DateTimeTestCase
(
unittest
.
TestCase
):
def
test_default
(
self
):
t
=
xmlrpclib
.
DateTime
()
with
mock
.
patch
(
'time.localtime'
)
as
localtime_mock
:
time_struct
=
time
.
struct_time
(
[
2013
,
7
,
15
,
0
,
24
,
49
,
0
,
196
,
0
])
localtime_mock
.
return_value
=
time_struct
localtime
=
time
.
localtime
()
t
=
xmlrpclib
.
DateTime
()
self
.
assertEqual
(
str
(
t
),
time
.
strftime
(
"%Y%m%dT%H:%M:%S"
,
localtime
))
def
test_time
(
self
):
d
=
1181399930.036952
...
...
@@ -286,7 +294,7 @@ class DateTimeTestCase(unittest.TestCase):
self
.
assertEqual
(
t1
,
tref
)
t2
=
xmlrpclib
.
_datetime
(
d
)
self
.
assertEqual
(
t
1
,
tref
)
self
.
assertEqual
(
t
2
,
tref
)
def
test_comparison
(
self
):
now
=
datetime
.
datetime
.
now
()
...
...
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