<s> from __future__ import absolute_import , unicode_literals <EOL> from werkzeug . routing import Rule <EOL> from mongorest . resource import Resource <EOL> from mongorest . testcase import TestCase <EOL> from mongorest . wrappers import Response <EOL> class TestResourceMeta ( TestCase ) : <EOL> def test_meta_adds_url_map_to_class_that_inherits_from_resource ( self ) : <EOL> class ResourceChild ( Resource ) : <EOL> rules = [ Rule ( '<STR_LIT:/>' , methods = [ '<STR_LIT:GET>' ] , endpoint = '<STR_LIT:test>' ) ] <EOL> def test ( self , requet ) : <EOL> return Response ( status = <NUM_LIT> ) <EOL> for rule in ResourceChild . rules : <EOL> self . assertTrue ( rule in list ( ResourceChild . url_map . iter_rules ( ) ) ) <EOL> def test_meta_adds_url_map_to_class_that_inherits_from_resources_child_classes ( self ) : <EOL> class ResourceChild1 ( Resource ) : <EOL> rules = [ Rule ( '<STR_LIT:/>' , methods = [ '<STR_LIT:GET>' ] , endpoint = '<STR_LIT>' ) ] <EOL> def test1 ( self , requet ) : <EOL> return Response ( status = <NUM_LIT> ) <EOL> class ResourceChild2 ( Resource ) : <EOL> rules = [ Rule ( '<STR_LIT:/>' , methods = [ '<STR_LIT:GET>' ] , endpoint = '<STR_LIT>' ) ] <EOL> def test2 ( self , requet ) : <EOL> return Response ( status = <NUM_LIT> ) <EOL> class ResourceChildsChild ( ResourceChild1 , ResourceChild2 ) : <EOL> pass <EOL> for rule in ResourceChild1 . rules + ResourceChild2 . rules : <EOL> self . assertTrue ( <EOL> rule in list ( ResourceChildsChild . url_map . iter_rules ( ) ) <EOL> ) </s>
