Example #1
0
 def handle(self, *args, **options):
     commands.log_command(
         options['port'],
         options['host'],
         options['chroot'],
         options['chdir'],
         options['uid'],
         options['gid'],
         options['umask'],
         options['pid'],
         options['force'],
     )
Example #2
0
 def handle(self, *args, **options):
     commands.log_command(
         options["port"],
         options["host"],
         options["chroot"],
         options["chdir"],
         options["uid"],
         options["gid"],
         options["umask"],
         options["pid"],
         options["force"],
     )
Example #3
0
def test_log_command(MockSMTPReceiver):
    ms = MockSMTPReceiver()
    ms.start.function()

    setup()  # make sure it's clear for fake.pid
    commands.log_command(pid="run/fake.pid")
    assert utils.daemonize.called
    assert ms.start.called

    # test that it exits on existing pid
    make_fake_pid_file()
    commands.log_command(pid="run/fake.pid")
    assert sys.exit.called
Example #4
0
def test_log_command(MockSMTPReceiver):
    ms = MockSMTPReceiver()
    ms.start.function()

    setup()  # make sure it's clear for fake.pid
    commands.log_command(pid="run/fake.pid")
    assert utils.daemonize.called
    assert ms.start.called

    # test that it exits on existing pid
    make_fake_pid_file()
    commands.log_command(pid="run/fake.pid")
    assert sys.exit.called