Force DummyServer to listen on IPv4
Ignore-this: 63465a1c491fb2438066f1f4bc303540 darcs-hash:20090630174050-86b55-65e864661db0bbc16ca3643455f776cd609f8488.gz
This commit is contained in:
@@ -48,8 +48,7 @@ if __name__ == '__main__':
|
|||||||
class MyTestProgram(unittest.TestProgram):
|
class MyTestProgram(unittest.TestProgram):
|
||||||
def runTests(self):
|
def runTests(self):
|
||||||
"""run tests but do not exit after"""
|
"""run tests but do not exit after"""
|
||||||
if self.testRunner is None:
|
self.testRunner = unittest.TextTestRunner(verbosity=self.verbosity)
|
||||||
self.testRunner = unittest.TextTestRunner(verbosity=self.verbosity)
|
|
||||||
self.testRunner.run(self.test)
|
self.testRunner.run(self.test)
|
||||||
|
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|||||||
@@ -686,13 +686,13 @@ class IMAPAccount_TestCase(InheritableAccount_TestCase):
|
|||||||
|
|
||||||
def test_build_folder_cache(self):
|
def test_build_folder_cache(self):
|
||||||
test_func = self.make_test(\
|
test_func = self.make_test(\
|
||||||
[lambda data: '* LIST () "." "INBOX"\r\n' + \
|
[lambda data: '* LIST () "." "INBOX"\r\n' + \
|
||||||
'* LIST () "." "INBOX.dir1"\r\n' + \
|
'* LIST () "." "INBOX.dir1"\r\n' + \
|
||||||
'* LIST () "." "INBOX.dir1.subdir1"\r\n' + \
|
'* LIST () "." "INBOX.dir1.subdir1"\r\n' + \
|
||||||
'* LIST () "." "INBOX.dir1.subdir2"\r\n' + \
|
'* LIST () "." "INBOX.dir1.subdir2"\r\n' + \
|
||||||
'* LIST () "." "INBOX.dir2"\r\n' + \
|
'* LIST () "." "INBOX.dir2"\r\n' + \
|
||||||
data.split()[0] + ' OK LIST completed\r\n'],
|
data.split()[0] + ' OK LIST completed\r\n'],
|
||||||
["^[^ ]* LIST \"\" \*"],
|
["^[^ ]* LIST \"\" \*"],
|
||||||
lambda self: self.assertEquals(self.imap_account._build_folder_cache(),
|
lambda self: self.assertEquals(self.imap_account._build_folder_cache(),
|
||||||
{"INBOX":
|
{"INBOX":
|
||||||
{"dir1":
|
{"dir1":
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ def xmldiff(node1, node2):
|
|||||||
|
|
||||||
class DummyServer:
|
class DummyServer:
|
||||||
def __init__(self, host, port, responses = None):
|
def __init__(self, host, port, responses = None):
|
||||||
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
|
for res in socket.getaddrinfo(host, port, socket.AF_INET, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
|
||||||
af, socktype, proto, canonname, sa = res
|
af, socktype, proto, canonname, sa = res
|
||||||
try:
|
try:
|
||||||
s = socket.socket(af, socktype, proto)
|
s = socket.socket(af, socktype, proto)
|
||||||
@@ -203,5 +203,3 @@ def test():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
test()
|
test()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user