def test_command_initd(sudo, exists): (exists .expects_call() .returns(False) .next_call() .with_args("/etc/init.d/foo") .returns(True)) sudo.expects_call().with_args("/etc/init.d/foo method") service.command("foo", "method")
def test_command_upstart(sudo, exists): exists.expects_call().with_args("/etc/init/foo.conf").returns(True) sudo.expects_call().with_args("method foo") service.command("foo", "method")