Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
    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')
Exemplo n.º 4
0
    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')
Exemplo n.º 5
0
 def test_ArgsLong(self, D):
     bigitrdaemon.main(['/foo', '--config', '/b', '--no-daemon', '--pid-file', '/b-p'])
     self.assertNonDefaultArgs(D)
Exemplo n.º 6
0
 def test_ArgsShort(self, D):
     bigitrdaemon.main(['/foo', '-c', '/b', '-n', '-p', '/b-p'])
     self.assertNonDefaultArgs(D)
Exemplo n.º 7
0
 def test_ArgsLong(self, D):
     bigitrdaemon.main(
         ['/foo', '--config', '/b', '--no-daemon', '--pid-file', '/b-p'])
     self.assertNonDefaultArgs(D)
Exemplo n.º 8
0
 def test_ArgsShort(self, D):
     bigitrdaemon.main(['/foo', '-c', '/b', '-n', '-p', '/b-p'])
     self.assertNonDefaultArgs(D)