def test_routing_class_with_cli_commands():
 @hug.object(name='git', version='1.0.0')
 class GIT(object, ):
  'An example of command like calls via an Object'
  @hug.object.cli
  def push(self, branch='master'):
   return 'Pushing {}'.format(branch)
  @hug.object.cli
  def pull(self, branch='master'):
   return 'Pulling {}'.format(branch)
 assert ('token' in hug.test.cli(GIT.push, branch='token'))
 assert ('another token' in hug.test.cli(GIT.pull, branch='another token'))

def test_routing_class_with_cli_commands ( ) : @ hug . object ( name = 'git' , version = '1.0.0' ) class GIT ( object , ) : @ hug . object . cli def push ( self , branch = 'master' ) : return 'Pushing {}' . format ( branch ) @ hug . object . cli def pull ( self , branch = 'master' ) : return 'Pulling {}' . format ( branch ) assert ( 'token' in hug . test . cli ( GIT . push , branch = 'token' ) ) assert ( 'another token' in hug . test . cli ( GIT . pull , branch = 'another token' ) )
basic operation test .