<s> from grab . spider import Spider , Task <EOL> from test . util import BaseGrabTestCase , build_spider <EOL> class MiscTest ( BaseGrabTestCase ) : <EOL> def setUp ( self ) : <EOL> self . server . reset ( ) <EOL> def test_null_grab_bug ( self ) : <EOL> server = self . server <EOL> class SimpleSpider ( Spider ) : <EOL> def task_generator ( self ) : <EOL> yield Task ( '<STR_LIT>' , url = server . get_url ( ) ) <EOL> def task_one ( self , grab , task ) : <EOL> self . stat . inc ( '<STR_LIT>' ) <EOL> yield Task ( '<STR_LIT>' , grab = grab ) <EOL> def task_two ( self , grab , task ) : <EOL> self . stat . inc ( '<STR_LIT>' ) <EOL> bot = build_spider ( SimpleSpider , thread_number = <NUM_LIT:1> ) <EOL> bot . run ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , bot . stat . counters [ '<STR_LIT>' ] ) </s>
