def test_simple_class_based_method_view():
 @hug.object.http_methods()
 class EndPoint(object, ):
  def get(self):
   return 'hi there!'
  def post(self):
   return 'bye'
 assert (hug.test.get(api, 'endpoint').data == 'hi there!')
 assert (hug.test.post(api, 'endpoint').data == 'bye')

def test_simple_class_based_method_view ( ) : @ hug . object . http_methods ( ) class EndPoint ( object , ) : def get ( self ) : return 'hi there!' def post ( self ) : return 'bye' assert ( hug . test . get ( api , 'endpoint' ) . data == 'hi there!' ) assert ( hug . test . post ( api , 'endpoint' ) . data == 'bye' )
test creating class based routers using method mappings .