Ejemplo n.º 1
0
 def _parse_one(self, arg):
     try:
         return commands._find_command(arg)
     except KeyError:
         raise CustomError("Could not find command '%s'." % arg)
Ejemplo n.º 2
0
 def test_looksupcommand(self):
     cmd = commands._find_command('foo-bar')
     self.assertIsInstance(cmd(None), commands.Command)
Ejemplo n.º 3
0
 def test_sets_name(self):
     cmd = commands._find_command('foo-bar')
     # The name is preserved, so that 'testr commands' shows something
     # sensible.
     self.assertEqual('foo-bar', cmd.name)
Ejemplo n.º 4
0
 def test_missing_command(self):
     self.assertThat(lambda: commands._find_command('bar'),
                     raises(KeyError))
Ejemplo n.º 5
0
 def test_sets_name(self):
     cmd = commands._find_command('foo')
     self.assertEqual('foo', cmd.name)
Ejemplo n.º 6
0
 def test_sets_name(self):
     cmd = commands._find_command('foo-bar')
     # The name is preserved, so that 'testr commands' shows something
     # sensible.
     self.assertEqual('foo-bar', cmd.name)
Ejemplo n.º 7
0
 def test_looksupcommand(self):
     cmd = commands._find_command('foo-bar')
     self.assertIsInstance(cmd(None), commands.Command)
Ejemplo n.º 8
0
 def test_sets_name(self):
     cmd = commands._find_command('foo')
     self.assertEqual('foo', cmd.name)
Ejemplo n.º 9
0
 def test_missing_command(self):
     self.assertThat(lambda: commands._find_command('bar'),
         raises(KeyError))
Ejemplo n.º 10
0
 def _parse_one(self, arg):
     try:
         return commands._find_command(arg)
     except KeyError:
         raise CustomError("Could not find command '%s'." % arg)