コード例 #1
0
ファイル: command_tests.py プロジェクト: 3kwa/lamson
def test_stop_command():
    # gave a bad pid file
    try:
        commands.stop_command(pid="run/dontexit.pid")
    except IOError:
        assert sys.exit.called

    make_fake_pid_file()
    commands.stop_command(pid="run/fake.pid")

    make_fake_pid_file()
    commands.stop_command(ALL="run")

    make_fake_pid_file()
    commands.stop_command(pid="run/fake.pid", KILL=True)
    assert os.kill.called
    assert not os.path.exists("run/fake.pid")

    make_fake_pid_file()
    os.kill.side_effect = raise_OSError
    commands.stop_command(pid="run/fake.pid", KILL=True)
コード例 #2
0
def test_stop_command():
    # gave a bad pid file
    try:
        commands.stop_command(pid="run/dontexit.pid")
    except IOError:
        assert sys.exit.called

    make_fake_pid_file()
    commands.stop_command(pid="run/fake.pid")

    make_fake_pid_file()
    commands.stop_command(ALL="run")

    make_fake_pid_file()
    commands.stop_command(pid="run/fake.pid", KILL=True)
    assert os.kill.called
    assert not os.path.exists("run/fake.pid")

    make_fake_pid_file()
    os.kill.side_effect = raise_OSError
    commands.stop_command(pid="run/fake.pid", KILL=True)
コード例 #3
0
ファイル: lamson_stop.py プロジェクト: fitoria/django-lamson
 def handle(self, *args, **options):
 	commands.stop_command(options['pid'],
 						  options['kill'],
 						  options['all'],
 							)
コード例 #4
0
ファイル: lamson_stop.py プロジェクト: fitoria/django-lamson
 def handle(self, *args, **options):
     commands.stop_command(
         options['pid'],
         options['kill'],
         options['all'],
     )