File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 2121 import ssl
2222except ImportError :
2323 ssl = None
24+ import warnings
2425
2526support .requires_working_socket (module = True )
2627
@@ -602,6 +603,17 @@ def test_unselect(self):
602603 self .assertEqual (data [0 ], b'Returned to authenticated state. (Success)' )
603604 self .assertEqual (client .state , 'AUTH' )
604605
606+ # property tests
607+
608+ def test_file_property (self ):
609+ client , _ = self ._setup (SimpleIMAPHandler )
610+ # 'file' attribute access should trigger a warning
611+ with warnings .catch_warnings (record = True ) as warned :
612+ warnings .simplefilter ('always' )
613+ client .file
614+ self .assertEqual (len (warned ), 1 )
615+ self .assertTrue (issubclass (warned [- 1 ].category , RuntimeWarning ))
616+
605617
606618class NewIMAPTests (NewIMAPTestsMixin , unittest .TestCase ):
607619 imap_class = imaplib .IMAP4
You can’t perform that action at this time.
0 commit comments