using ConfigParser.read_file for PY3
This commit is contained in:
parent
8cc1c93dc2
commit
9ddae41877
6 changed files with 76 additions and 23 deletions
|
|
@ -270,7 +270,10 @@ connect_timeout = 10
|
|||
send_timeout = 60
|
||||
""")
|
||||
conf = SafeConfigParser()
|
||||
conf.readfp(confdata)
|
||||
if six.PY2:
|
||||
conf.readfp(confdata)
|
||||
else:
|
||||
conf.read_file(confdata)
|
||||
self.handler = protonmsg.TimeoutHandler('amqps://broker1.example.com:5671', [], conf)
|
||||
|
||||
@patch('protonmsg.SSLDomain')
|
||||
|
|
@ -291,7 +294,10 @@ connect_timeout = 10
|
|||
send_timeout = 60
|
||||
""")
|
||||
conf = SafeConfigParser()
|
||||
conf.readfp(confdata)
|
||||
if six.PY2:
|
||||
conf.readfp(confdata)
|
||||
else:
|
||||
conf.read_file(confdata)
|
||||
handler = protonmsg.TimeoutHandler('amqp://broker1.example.com:5672', [], conf)
|
||||
event = MagicMock()
|
||||
handler.on_start(event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue