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