def test_simple_class_based_view():
 @hug.object.urls('/endpoint', requires=())
 class MyClass(object, ):
  @hug.object.get()
  def my_method(self):
   return 'hi there!'
  @hug.object.post()
  def my_method_two(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_view ( ) : @ hug . object . urls ( '/endpoint' , requires = ( ) ) class MyClass ( object , ) : @ hug . object . get ( ) def my_method ( self ) : return 'hi there!' @ hug . object . post ( ) def my_method_two ( 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 .