def test_good_run(self): import ftprelayer self.mox.StubOutClassWithMocks(ftprelayer, 'Application') self.mox.StubOutWithMock(ftprelayer, 'log') app = ftprelayer.Application args = ['./ftprelayer', 'som_config'] app.from_config(args[1]).AndReturn(app) ftprelayer.log.info("Starting app") app.start(True) app.stop() self.mox.ReplayAll() ftprelayer.main(args)
def test_too_few_args(self): import ftprelayer self.assertEqual(-1, ftprelayer.main(['./ftprelayer']))