Пример #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
 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
 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
 def test_get_env_var_name(self):
     command = CompletionCommand('foo')
     self.assertEqual(command.get_env_var_name(), 'FOO_AUTO_COMPLETE')