diff options
author | R David Murray <rdmurray@bitdance.com> | 2011-05-02 12:47:24 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2011-05-02 12:47:24 (GMT) |
commit | b912c5a004068e472b1b46fad68445e70934e280 (patch) | |
tree | 54394b7f456c539e0d4a7ea576736a15d4b3acad /Lib/test/test_smtplib.py | |
parent | 38cfe89665604b5ea786b6708c175d5916c7afb1 (diff) | |
download | cpython-b912c5a004068e472b1b46fad68445e70934e280.zip cpython-b912c5a004068e472b1b46fad68445e70934e280.tar.gz cpython-b912c5a004068e472b1b46fad68445e70934e280.tar.bz2 |
I was right, hardconding the localhost IP doesn't work in linux-vserver.
Diffstat (limited to 'Lib/test/test_smtplib.py')
-rw-r--r-- | Lib/test/test_smtplib.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 4651f37..884529f 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -290,8 +290,7 @@ class DebuggingServerTests(unittest.TestCase): self.serv_evt.wait() self.output.flush() # Add the X-Peer header that DebuggingServer adds - # XXX: I'm not sure hardcoding this IP will work on linux-vserver. - m['X-Peer'] = '127.0.0.1' + m['X-Peer'] = socket.gethostbyname('localhost') mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) @@ -311,8 +310,7 @@ class DebuggingServerTests(unittest.TestCase): self.serv_evt.wait() self.output.flush() # Add the X-Peer header that DebuggingServer adds - # XXX: I'm not sure hardcoding this IP will work on linux-vserver. - m['X-Peer'] = '127.0.0.1' + m['X-Peer'] = socket.gethostbyname('localhost') # The Bcc header is deleted before serialization. del m['Bcc'] mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) @@ -341,8 +339,7 @@ class DebuggingServerTests(unittest.TestCase): self.serv_evt.wait() self.output.flush() # Add the X-Peer header that DebuggingServer adds - # XXX: I'm not sure hardcoding this IP will work on linux-vserver. - m['X-Peer'] = '127.0.0.1' + m['X-Peer'] = socket.gethostbyname('localhost') mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) debugout = smtpd.DEBUGSTREAM.getvalue() |