def test_emptyArgs(self, D): if 'BIGITR_DAEMON_CONFIG' in os.environ: del os.environ['BIGITR_DAEMON_CONFIG'] if 'BIGITR_DAEMON_PIDFILE' in os.environ: del os.environ['BIGITR_DAEMON_PIDFILE'] bigitrdaemon.main(['/foo']) D.assert_called_once_with('/foo', '~/.bigitrd', True, '~/.bigitrd-pid') D().run.assert_called_once_with()
def test_emptyArgs(self, D): if 'BIGITR_DAEMON_CONFIG' in os.environ: del os.environ['BIGITR_DAEMON_CONFIG'] if 'BIGITR_DAEMON_PIDFILE' in os.environ: del os.environ['BIGITR_DAEMON_PIDFILE'] bigitrdaemon.main(['/foo']) D.assert_called_once_with( '/foo', '~/.bigitrd', True, '~/.bigitrd-pid') D().run.assert_called_once_with()
def test_emptyArgsWithEnvironment(self, D): os.environ['BIGITR_DAEMON_CONFIG'] = '/b' os.environ['BIGITR_DAEMON_PIDFILE'] = '/b-p' try: bigitrdaemon.main(['/foo']) D.assert_called_once_with('/foo', '/b', True, '/b-p') D().run.assert_called_once_with() finally: os.unsetenv('BIGITR_DAEMON_CONFIG') os.unsetenv('BIGITR_DAEMON_PIDFILE')
def test_ArgsLong(self, D): bigitrdaemon.main(['/foo', '--config', '/b', '--no-daemon', '--pid-file', '/b-p']) self.assertNonDefaultArgs(D)
def test_ArgsShort(self, D): bigitrdaemon.main(['/foo', '-c', '/b', '-n', '-p', '/b-p']) self.assertNonDefaultArgs(D)
def test_ArgsLong(self, D): bigitrdaemon.main( ['/foo', '--config', '/b', '--no-daemon', '--pid-file', '/b-p']) self.assertNonDefaultArgs(D)