class DeploymentUserVerifierTest(mox.MoxTestBase):
    def setUp(self):
        super(DeploymentUserVerifierTest, self).setUp()
        self.mock_permissions = self.mox.CreateMock(AkvoPermissions)

        self.deployment_user_verifier = DeploymentUserVerifier(
            self.mock_permissions)

    def test_can_verify_expected_sudo_permission_for_sepcified_user(self):
        """fab.tests.verifiers.deployment_user_verifier_test  Can verify expected sudo permission for a specified user"""

        self.mock_permissions.exit_if_user_does_not_have_sudo_permission(
            "jane")
        self.mox.ReplayAll()

        self.deployment_user_verifier.verify_sudo_permission_for("jane")

    def test_can_verify_expected_sudo_and_web_admin_permissions_for_sepcified_user(
            self):
        """fab.tests.verifiers.deployment_user_verifier_test  Can verify expected sudo and web admin permissions for a specified user"""

        self.mock_permissions.exit_if_user_does_not_have_sudo_permission(
            "jane")
        self.mock_permissions.exit_if_user_is_not_member_of_web_group("jane")
        self.mox.ReplayAll()

        self.deployment_user_verifier.verify_sudo_and_web_admin_permissions_for(
            "jane")
Beispiel #2
0
    def create_with(host_controller):
        permissions = AkvoPermissions(host_controller)

        return DeploymentHost(FileSystem(host_controller),
                              DeploymentUserVerifier(permissions), permissions,
                              Internet(host_controller),
                              host_controller.feedback)
Beispiel #3
0
    def create_with(virtualenv_installer_config, host_controller):
        file_system = FileSystem(host_controller)
        permissions = AkvoPermissions(host_controller)

        return VirtualEnvDeploymentHost(
            virtualenv_installer_config, file_system,
            DeploymentUserVerifier(permissions), permissions,
            Internet(host_controller),
            VirtualEnvInstaller.create_with(virtualenv_installer_config,
                                            host_controller, file_system),
            host_controller.feedback)
Beispiel #4
0
    def create_with(deployment_host_config):
        host_controller = RemoteHostController()

        return LinuxHost(
            DeploymentUserVerifier(AkvoPermissions(host_controller)),
            PythonInstaller.create_with(host_controller),
            UbuntuPackageInspector(host_controller),
            LinuxPackageVerifier.create_with(host_controller),
            SystemPythonPackageInstaller.create_with(deployment_host_config,
                                                     host_controller),
            host_controller.feedback)
class DeploymentUserVerifierTest(mox.MoxTestBase):

    def setUp(self):
        super(DeploymentUserVerifierTest, self).setUp()
        self.mock_permissions = self.mox.CreateMock(AkvoPermissions)

        self.deployment_user_verifier = DeploymentUserVerifier(self.mock_permissions)

    def test_can_verify_expected_sudo_permission_for_sepcified_user(self):
        """fab.tests.verifiers.deployment_user_verifier_test  Can verify expected sudo permission for a specified user"""

        self.mock_permissions.exit_if_user_does_not_have_sudo_permission("jane")
        self.mox.ReplayAll()

        self.deployment_user_verifier.verify_sudo_permission_for("jane")

    def test_can_verify_expected_sudo_and_web_admin_permissions_for_sepcified_user(self):
        """fab.tests.verifiers.deployment_user_verifier_test  Can verify expected sudo and web admin permissions for a specified user"""

        self.mock_permissions.exit_if_user_does_not_have_sudo_permission("jane")
        self.mock_permissions.exit_if_user_is_not_member_of_web_group("jane")
        self.mox.ReplayAll()

        self.deployment_user_verifier.verify_sudo_and_web_admin_permissions_for("jane")
    def setUp(self):
        super(DeploymentUserVerifierTest, self).setUp()
        self.mock_permissions = self.mox.CreateMock(AkvoPermissions)

        self.deployment_user_verifier = DeploymentUserVerifier(
            self.mock_permissions)
    def setUp(self):
        super(DeploymentUserVerifierTest, self).setUp()
        self.mock_permissions = self.mox.CreateMock(AkvoPermissions)

        self.deployment_user_verifier = DeploymentUserVerifier(self.mock_permissions)