@@ -22,16 +22,22 @@ def test_welcome(self):
2222 self .assertEqual (str , type (welcome ))
2323
2424 def test_help (self ):
25- resp , list = self .server .help ()
25+ resp , lines = self .server .help ()
2626 self .assertTrue (resp .startswith ("100 " ), resp )
27- for line in list :
27+ for line in lines :
2828 self .assertEqual (str , type (line ))
2929
3030 def test_list (self ):
31- resp , list = self .server .list ()
32- if len (list ) > 0 :
33- self .assertEqual (GroupInfo , type (list [0 ]))
34- self .assertEqual (str , type (list [0 ].group ))
31+ resp , groups = self .server .list ()
32+ if len (groups ) > 0 :
33+ self .assertEqual (GroupInfo , type (groups [0 ]))
34+ self .assertEqual (str , type (groups [0 ].group ))
35+
36+ def test_list_active (self ):
37+ resp , groups = self .server .list (self .GROUP_PAT )
38+ if len (groups ) > 0 :
39+ self .assertEqual (GroupInfo , type (groups [0 ]))
40+ self .assertEqual (str , type (groups [0 ].group ))
3541
3642 def test_unknown_command (self ):
3743 with self .assertRaises (nntplib .NNTPPermanentError ) as cm :
@@ -383,6 +389,17 @@ def handle_LIST(self, action=None, param=None):
383389 free.it.comp.lang.python.learner 0000000000 0000000001 y
384390 tw.bbs.comp.lang.python 0000000304 0000000304 y
385391 .""" )
392+ elif action == "ACTIVE" :
393+ if param == "*distutils*" :
394+ self .push_lit ("""\
395+ 215 Newsgroups in form "group high low flags"
396+ gmane.comp.python.distutils.devel 0000014104 0000000001 m
397+ gmane.comp.python.distutils.cvs 0000000000 0000000001 m
398+ .""" )
399+ else :
400+ self .push_lit ("""\
401+ 215 Newsgroups in form "group high low flags"
402+ .""" )
386403 elif action == "OVERVIEW.FMT" :
387404 self .push_lit ("""\
388405 215 Order of fields in overview database.
@@ -608,6 +625,12 @@ def test_list(self):
608625 self .assertEqual (g ,
609626 GroupInfo ("comp.lang.python.announce" , "0000001153" ,
610627 "0000000993" , "m" ))
628+ resp , groups = self .server .list ("*distutils*" )
629+ self .assertEqual (len (groups ), 2 )
630+ g = groups [0 ]
631+ self .assertEqual (g ,
632+ GroupInfo ("gmane.comp.python.distutils.devel" , "0000014104" ,
633+ "0000000001" , "m" ))
611634
612635 def test_stat (self ):
613636 resp , art_num , message_id = self .server .stat (3000234 )
0 commit comments