def test_it_runs(self, mymock):
     """run_make_action should return the output of running an action"""
     stub = "this is output"
     mymock.return_value = stub
     eq_(stub, run_make_action("home/docker","dockerapp","action"))
     call = "cd home/docker/dockerapp; make action"
     mymock.assert_called_with(call)
Example #2
0
 def test_it_runs(self, mymock):
     """run_make_action should return the output of running an action"""
     stub = "this is output"
     mymock.return_value = stub
     eq_(stub, run_make_action("home/docker", "dockerapp", "action"))
     call = "cd home/docker/dockerapp; make action"
     mymock.assert_called_with(call)
Example #3
0
def console_view():
    """
    This view shows the result of running some action
    from the Makefile, on the selected service
    """
    action = request.args.get("a")
    service = request.args.get("s")

    result = run_make_action(
        expanduser(app.config["DOCKER_SERVICES_HOME"]),
        service,
        action)

    service_data = {
        "name": service,
        "action": {
            "name": action,
            "result": result}}

    return render_template(
        "console.html",
        data={"service": service_data, "debug": app.config["DEBUG"] })
Example #4
0
def console_view():
    """
    This view shows the result of running some action
    from the Makefile, on the selected service
    """
    action = request.args.get("a")
    service = request.args.get("s")

    result = run_make_action(expanduser(app.config["DOCKER_SERVICES_HOME"]),
                             service, action)

    service_data = {
        "name": service,
        "action": {
            "name": action,
            "result": result
        }
    }

    return render_template("console.html",
                           data={
                               "service": service_data,
                               "debug": app.config["DEBUG"]
                           })