django-fab-deploy / fab_deploy_tests / tests / uwsgi_prepare.py

# coding: utf-8
from __future__ import absolute_import
from fabric.api import run, env, abort
from fabtest import fab, FabricAbortException

from fab_deploy.utils import run_as
from fab_deploy.system import prepare, ssh_add_key
from fab_deploy.project import WebProject
from fab_deploy.django import Django
from fab_deploy.webserver.nginx import Nginx
from fab_deploy.webserver.uwsgi import Uwsgi

from fab_deploy_tests.utils import setup_ssh, public_key_path, setup_sudo
from .base import FabDeployTest

class UwsgiPrepareTest(FabDeployTest):
    def test_prepare_server_ok(self):
        setup_sudo()
        setup_ssh()

        fab(prepare)
        self.assertPackageInstalled('python')
        project = WebProject(dict(django=Django(Nginx(), Uwsgi()))).expose_as_module('project')
        apps = project.apps
        fab(apps.django.backend.install, confirm=False)
        fab(apps.django.frontend.install)
        self.assertPackageInstalled('nginx')
        self.assertPackageInstalled('uwsgi')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.