Esempio n. 1
0
 def test_set_var_wrong_args(self):
     command.show_help(['test']).AndRaise(SystemExit)
     self.mox.ReplayAll()
     self.assertRaises(SystemExit, command.set_var, ['test'])
Esempio n. 2
0
 def test_main_catches(self):
     command.show_help(['test']).AndRaise(RuntimeError('catch me'))
     command.die('Failed: %s', mox.IsA(RuntimeError))
     self.mox.ReplayAll()
     command.main(['test'])
Esempio n. 3
0
    def test_show_help(self):
        self.mox.StubOutWithMock(command, 'die')
        command.die(mox.IsA(basestring))

        self.mox.ReplayAll()
        command.show_help(['test'])
Esempio n. 4
0
 def test_main_no_args(self):
     command.show_help(['test']).AndRaise(SystemExit)
     self.mox.ReplayAll()
     self.assertRaises(SystemExit, command.main, ['test'])