@@ -53,10 +53,6 @@ def write_line(line):
5353 write_line (b'DATA' )
5454 self .assertRaises (NotImplementedError , write_line , b'spam\r \n .\r \n ' )
5555
56- def test_decode_data_default_warns (self ):
57- with self .assertWarns (DeprecationWarning ):
58- smtpd .SMTPServer ((support .HOST , 0 ), ('b' , 0 ))
59-
6056 def test_decode_data_and_enable_SMTPUTF8_raises (self ):
6157 self .assertRaises (
6258 ValueError ,
@@ -108,10 +104,9 @@ def test_process_message_with_decode_data_true(self):
108104 """ ))
109105
110106 def test_process_message_with_decode_data_false (self ):
111- server = smtpd .DebuggingServer ((support .HOST , 0 ), ('b' , 0 ),
112- decode_data = False )
107+ server = smtpd .DebuggingServer ((support .HOST , 0 ), ('b' , 0 ))
113108 conn , addr = server .accept ()
114- channel = smtpd .SMTPChannel (server , conn , addr , decode_data = False )
109+ channel = smtpd .SMTPChannel (server , conn , addr )
115110 with support .captured_stdout () as s :
116111 self .send_data (channel , b'From: test\n \n h\xc3 \xa9 llo\xff \n ' )
117112 stdout = s .getvalue ()
@@ -175,13 +170,11 @@ def tearDown(self):
175170
176171 @unittest .skipUnless (support .IPV6_ENABLED , "IPv6 not enabled" )
177172 def test_socket_uses_IPv6 (self ):
178- server = smtpd .SMTPServer ((support .HOSTv6 , 0 ), (support .HOST , 0 ),
179- decode_data = False )
173+ server = smtpd .SMTPServer ((support .HOSTv6 , 0 ), (support .HOST , 0 ))
180174 self .assertEqual (server .socket .family , socket .AF_INET6 )
181175
182176 def test_socket_uses_IPv4 (self ):
183- server = smtpd .SMTPServer ((support .HOST , 0 ), (support .HOSTv6 , 0 ),
184- decode_data = False )
177+ server = smtpd .SMTPServer ((support .HOST , 0 ), (support .HOSTv6 , 0 ))
185178 self .assertEqual (server .socket .family , socket .AF_INET )
186179
187180
@@ -204,18 +197,18 @@ def write_line(self, channel, line):
204197 channel .handle_read ()
205198
206199 def test_params_rejected (self ):
207- server = DummyServer ((support .HOST , 0 ), ('b' , 0 ), decode_data = False )
200+ server = DummyServer ((support .HOST , 0 ), ('b' , 0 ))
208201 conn , addr = server .accept ()
209- channel = smtpd .SMTPChannel (server , conn , addr , decode_data = False )
202+ channel = smtpd .SMTPChannel (server , conn , addr )
210203 self .write_line (channel , b'EHLO example' )
211204 self .
write_line (
channel ,
b'MAIL from: <[email protected] > size=20' )
212205 self .
write_line (
channel ,
b'RCPT to: <[email protected] > foo=bar' )
213206 self .assertEqual (channel .socket .last , self .error_response )
214207
215208 def test_nothing_accepted (self ):
216- server = DummyServer ((support .HOST , 0 ), ('b' , 0 ), decode_data = False )
209+ server = DummyServer ((support .HOST , 0 ), ('b' , 0 ))
217210 conn , addr = server .accept ()
218- channel = smtpd .SMTPChannel (server , conn , addr , decode_data = False )
211+ channel = smtpd .SMTPChannel (server , conn , addr )
219212 self .write_line (channel , b'EHLO example' )
220213 self .
write_line (
channel ,
b'MAIL from: <[email protected] > size=20' )
221214 self .
write_line (
channel ,
b'RCPT to: <[email protected] >' )
@@ -257,9 +250,9 @@ def test_with_decode_data_true(self):
257250 self .assertEqual (channel .socket .last , b'250 OK\r \n ' )
258251
259252 def test_with_decode_data_false (self ):
260- server = DummyServer ((support .HOST , 0 ), ('b' , 0 ), decode_data = False )
253+ server = DummyServer ((support .HOST , 0 ), ('b' , 0 ))
261254 conn , addr = server .accept ()
262- channel = smtpd .SMTPChannel (server , conn , addr , decode_data = False )
255+ channel = smtpd .SMTPChannel (server , conn , addr )
263256 self .write_line (channel , b'EHLO example' )
264257 for line in [
265258 b'MAIL from: <[email protected] > size=20 SMTPUTF8' ,
@@ -765,13 +758,6 @@ def test_attribute_deprecations(self):
765758 with support .check_warnings (('' , DeprecationWarning )):
766759 self .channel ._SMTPChannel__addr = 'spam'
767760
768- def test_decode_data_default_warning (self ):
769- with self .assertWarns (DeprecationWarning ):
770- server = DummyServer ((support .HOST , 0 ), ('b' , 0 ))
771- conn , addr = self .server .accept ()
772- with self .assertWarns (DeprecationWarning ):
773- smtpd .SMTPChannel (server , conn , addr )
774-
775761@unittest .skipUnless (support .IPV6_ENABLED , "IPv6 not enabled" )
776762class SMTPDChannelIPv6Test (SMTPDChannelTest ):
777763 def setUp (self ):
@@ -845,12 +831,9 @@ def setUp(self):
845831 smtpd .socket = asyncore .socket = mock_socket
846832 self .old_debugstream = smtpd .DEBUGSTREAM
847833 self .debug = smtpd .DEBUGSTREAM = io .StringIO ()
848- self .server = DummyServer ((support .HOST , 0 ), ('b' , 0 ),
849- decode_data = False )
834+ self .server = DummyServer ((support .HOST , 0 ), ('b' , 0 ))
850835 conn , addr = self .server .accept ()
851- # Set decode_data to False
852- self .channel = smtpd .SMTPChannel (self .server , conn , addr ,
853- decode_data = False )
836+ self .channel = smtpd .SMTPChannel (self .server , conn , addr )
854837
855838 def tearDown (self ):
856839 asyncore .close_all ()
0 commit comments