#NEWLINE# def test_add_url_rules( self ) : #NEWLINE# #INDENT# with self . app . test_request_context ( '/whatever/' , method = 'GET' ) : #NEWLINE# #INDENT# FlTestResource . add_url_rules ( self . app , '/api/' ) #NEWLINE# rules = sorted ( [ rule . endpoint for rule in self . app . url_map . iter_rules ( ) ] ) #NEWLINE# self . assertEqual ( len ( rules ) , 3 ) #NEWLINE# self . assertEqual ( rules [ 0 ] , 'api_fltest_detail' ) #NEWLINE# self . assertEqual ( rules [ 1 ] , 'api_fltest_list' ) #NEWLINE# FlTestResource . add_url_rules ( self . app , '/api/' , endpoint_prefix = 'v2_tests' ) #NEWLINE# rules = sorted ( [ rule . endpoint for rule in self . app . url_map . iter_rules ( ) ] ) #NEWLINE# self . assertEqual ( len ( rules ) , 5 ) #NEWLINE# self . assertEqual ( rules [ 3 ] , 'v2_tests_detail' ) #NEWLINE# self . assertEqual ( rules [ 4 ] , 'v2_tests_list' )