示例#1
0
 def test_sets_name(self):
     cmd = commands._find_command('foo-bar')
     # The name is preserved, so that 'crcache commands' shows something
     # sensible.
     self.assertEqual('foo-bar', cmd.name)
示例#2
0
 def test_sets_name(self):
     cmd = commands._find_command('foo')
     self.assertEqual('foo', cmd.name)
示例#3
0
 def test_looksupcommand(self):
     cmd = commands._find_command('foo-bar')
     self.assertIsInstance(cmd(None), commands.Command)
示例#4
0
 def test_missing_command(self):
     self.assertThat(lambda: commands._find_command('bar'),
         raises(KeyError))