コード例 #1
0
 def test_handle(self):
     stream = io.StringIO()
     command = CompletionCommand('foo', stream)
     command.template = 'bar'
     command.handle(argparse.Namespace())
     self.assertEqual(stream.getvalue(), 'bar')
コード例 #2
0
 def test_get_completion_snippet(self):
     command = CompletionCommand('foo')
     command.template = '%(prog_name)s | %(ENV_VAR_NAME)s'
     self.assertEqual(command.get_completion_snippet(),
                      'foo | FOO_AUTO_COMPLETE')
コード例 #3
0
 def test_get_env_var_name(self):
     command = CompletionCommand('foo')
     self.assertEqual(command.get_env_var_name(), 'FOO_AUTO_COMPLETE')
コード例 #4
0
ファイル: test_cli_completion.py プロジェクト: hzlf/monolith
 def test_handle(self):
     stream = io.StringIO()
     command = CompletionCommand('foo', stream)
     command.template = 'bar'
     command.handle(argparse.Namespace())
     self.assertEqual(stream.getvalue(), 'bar')
コード例 #5
0
ファイル: test_cli_completion.py プロジェクト: hzlf/monolith
 def test_get_completion_snippet(self):
     command = CompletionCommand('foo')
     command.template = '%(prog_name)s | %(ENV_VAR_NAME)s'
     self.assertEqual(command.get_completion_snippet(),
         'foo | FOO_AUTO_COMPLETE')
コード例 #6
0
ファイル: test_cli_completion.py プロジェクト: hzlf/monolith
 def test_get_env_var_name(self):
     command = CompletionCommand('foo')
     self.assertEqual(command.get_env_var_name(), 'FOO_AUTO_COMPLETE')