<s> import unittest <EOL> from hn import HN , Story <EOL> from hn import utils , constants <EOL> from test_utils import get_content , PRESETS_DIR <EOL> import httpretty <EOL> class TestGetLeaders ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . hn = HN ( ) <EOL> httpretty . HTTPretty . enable ( ) <EOL> httpretty . register_uri ( httpretty . GET , '<STR_LIT>' % ( constants . BASE_URL , <EOL> '<STR_LIT>' ) , <EOL> body = get_content ( '<STR_LIT>' ) ) <EOL> def tearDown ( self ) : <EOL> httpretty . HTTPretty . disable ( ) <EOL> def test_get_leaders_with_no_parameter ( self ) : <EOL> result = [ leader for leader in self . hn . get_leaders ( ) ] <EOL> self . assertEqual ( len ( result ) , <NUM_LIT:10> ) <EOL> def test_get_leaders_with_parameter ( self ) : <EOL> value = <NUM_LIT:50> <EOL> result = [ leader for leader in self . hn . get_leaders ( value ) ] <EOL> self . assertEqual ( len ( result ) , value ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
