Exemplo n.º 1
0
 def test_returns_execute_result(self):
     self.stub__find_command(lambda x:1)
     self.assertEqual(1, commands.run_argv(['crcache', 'foo'], 'in', 'out',
         'err'))
Exemplo n.º 2
0
 def test_returns_0_when_None_returned_from_execute(self):
     self.stub__find_command(lambda x:None)
     self.assertEqual(0, commands.run_argv(['crcache', 'foo'], 'in', 'out',
         'err'))
Exemplo n.º 3
0
 def test_no_cmd_issues_help(self):
     self.stub__find_command(lambda x:0)
     commands.run_argv(['crcache', '--version'], 'in', 'out', 'err')
     self.assertEqual(['help'], self.calls)
Exemplo n.º 4
0
 def test_runs_cmd_with_CLI_UI(self):
     self.stub__find_command(self.capture_ui)
     commands.run_argv(['crcache', '--version', 'foo'], 'in', 'out', 'err')
     self.assertEqual(['foo'], self.calls)
     self.assertIsInstance(self.ui, cli.UI)
Exemplo n.º 5
0
 def test_looks_up_cmd_skips_options(self):
     self.stub__find_command(lambda x:0)
     commands.run_argv(['crcache', '--version', 'foo'], 'in', 'out', 'err')
     self.assertEqual(['foo'], self.calls)