Esempio n. 1
0
 def _parse_one(self, arg):
     try:
         return commands._find_command(arg)
     except KeyError:
         raise CustomError("Could not find command '%s'." % arg)
Esempio n. 2
0
 def test_looksupcommand(self):
     cmd = commands._find_command('foo-bar')
     self.assertIsInstance(cmd(None), commands.Command)
Esempio 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)
Esempio n. 4
0
 def test_missing_command(self):
     self.assertThat(lambda: commands._find_command('bar'),
                     raises(KeyError))
Esempio n. 5
0
 def test_sets_name(self):
     cmd = commands._find_command('foo')
     self.assertEqual('foo', cmd.name)
Esempio 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)
Esempio n. 7
0
 def test_looksupcommand(self):
     cmd = commands._find_command('foo-bar')
     self.assertIsInstance(cmd(None), commands.Command)
Esempio n. 8
0
 def test_sets_name(self):
     cmd = commands._find_command('foo')
     self.assertEqual('foo', cmd.name)
Esempio n. 9
0
 def test_missing_command(self):
     self.assertThat(lambda: commands._find_command('bar'),
         raises(KeyError))
Esempio n. 10
0
 def _parse_one(self, arg):
     try:
         return commands._find_command(arg)
     except KeyError:
         raise CustomError("Could not find command '%s'." % arg)