summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-05-02 12:48:00 (GMT)
committerR David Murray <rdmurray@bitdance.com>2011-05-02 12:48:00 (GMT)
commit477a6eb4a261ef8e68fbfc18d72b1011b2b19cd7 (patch)
treea48662a963adcb29da3c3b380238a172e7de5352 /Lib
parent2265cf4c2ec926ebb4147261dca00d1f5a3a9e2a (diff)
parentb912c5a004068e472b1b46fad68445e70934e280 (diff)
downloadcpython-477a6eb4a261ef8e68fbfc18d72b1011b2b19cd7.zip
cpython-477a6eb4a261ef8e68fbfc18d72b1011b2b19cd7.tar.gz
cpython-477a6eb4a261ef8e68fbfc18d72b1011b2b19cd7.tar.bz2
Merge: I was right, hardconding the localhost IP doesn't work in linux-vserver.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_smtplib.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index d973faa..dfe08fa 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()