diff options
author | David Rousselie <dax@happycoders.org> | 2009-06-30 21:40:50 +0400 |
---|---|---|
committer | David Rousselie <dax@happycoders.org> | 2009-06-30 21:40:50 +0400 |
commit | 9bab12811370cda2e9b858e67d84c7843a836505 (patch) | |
tree | ced255d435f9af6bd14dff39a085bf069cab2a7a | |
parent | e829fa68f47884bc41b8c51f5e21ce568b47313d (diff) |
Force DummyServer to listen on IPv4
Ignore-this: 63465a1c491fb2438066f1f4bc303540
darcs-hash:20090630174050-86b55-65e864661db0bbc16ca3643455f776cd609f8488.gz
-rw-r--r-- | run_tests.py | 3 | ||||
-rw-r--r-- | src/jmc/model/tests/account.py | 14 | ||||
-rw-r--r-- | src/jmc/model/tests/server.py | 4 |
3 files changed, 9 insertions, 12 deletions
diff --git a/run_tests.py b/run_tests.py index 085df7a..844c43b 100644 --- a/run_tests.py +++ b/run_tests.py @@ -48,8 +48,7 @@ if __name__ == '__main__': class MyTestProgram(unittest.TestProgram): def runTests(self): """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) logger = logging.getLogger() diff --git a/src/jmc/model/tests/account.py b/src/jmc/model/tests/account.py index 6790567..3affb13 100644 --- a/src/jmc/model/tests/account.py +++ b/src/jmc/model/tests/account.py @@ -686,13 +686,13 @@ class IMAPAccount_TestCase(InheritableAccount_TestCase): def test_build_folder_cache(self): test_func = self.make_test(\ - [lambda data: '* LIST () "." "INBOX"\r\n' + \ - '* LIST () "." "INBOX.dir1"\r\n' + \ - '* LIST () "." "INBOX.dir1.subdir1"\r\n' + \ - '* LIST () "." "INBOX.dir1.subdir2"\r\n' + \ - '* LIST () "." "INBOX.dir2"\r\n' + \ - data.split()[0] + ' OK LIST completed\r\n'], - ["^[^ ]* LIST \"\" \*"], + [lambda data: '* LIST () "." "INBOX"\r\n' + \ + '* LIST () "." "INBOX.dir1"\r\n' + \ + '* LIST () "." "INBOX.dir1.subdir1"\r\n' + \ + '* LIST () "." "INBOX.dir1.subdir2"\r\n' + \ + '* LIST () "." "INBOX.dir2"\r\n' + \ + data.split()[0] + ' OK LIST completed\r\n'], + ["^[^ ]* LIST \"\" \*"], lambda self: self.assertEquals(self.imap_account._build_folder_cache(), {"INBOX": {"dir1": diff --git a/src/jmc/model/tests/server.py b/src/jmc/model/tests/server.py index 9ed8ca0..e0a25a9 100644 --- a/src/jmc/model/tests/server.py +++ b/src/jmc/model/tests/server.py @@ -53,7 +53,7 @@ def xmldiff(node1, node2): class DummyServer: 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 try: s = socket.socket(af, socktype, proto) @@ -203,5 +203,3 @@ def test(): if __name__ == '__main__': test() - - |