class LinuxHostBaseTaskTest(mox.MoxTestBase):

    def setUp(self):
        super(LinuxHostBaseTaskTest, self).setUp()
        self.mock_config_loader = self.mox.CreateMock(DeploymentConfigLoader)

        self.linux_host_base_task = LinuxHostBaseTask()
        self.linux_host_base_task.config_loader = self.mock_config_loader

    def test_can_configure_linux_host_with_given_host_config_specification(self):
        """fab.tests.tasks.environment.linux_host_base_task_test  Can configure Linux host with the given host configuration specification"""

        host_config_spec = HostConfigSpecification().create_preconfigured_with(HostAlias.TEST)

        self.mock_config_loader.parse(host_config_spec).AndReturn(CIDeploymentHostConfig.for_test())
        self.mox.ReplayAll()

        self.assertIsInstance(self.linux_host_base_task._configure_linux_host_with(host_config_spec), LinuxHost)
class LinuxHostBaseTaskTest(mox.MoxTestBase):
    def setUp(self):
        super(LinuxHostBaseTaskTest, self).setUp()
        self.mock_config_loader = self.mox.CreateMock(DeploymentConfigLoader)

        self.linux_host_base_task = LinuxHostBaseTask()
        self.linux_host_base_task.config_loader = self.mock_config_loader

    def test_can_configure_linux_host_with_given_host_config_specification(
            self):
        """fab.tests.tasks.environment.linux_host_base_task_test  Can configure Linux host with the given host configuration specification"""

        host_config_spec = HostConfigSpecification().create_preconfigured_with(
            HostAlias.TEST)

        self.mock_config_loader.parse(host_config_spec).AndReturn(
            CIDeploymentHostConfig.for_test())
        self.mox.ReplayAll()

        self.assertIsInstance(
            self.linux_host_base_task._configure_linux_host_with(
                host_config_spec), LinuxHost)
    def setUp(self):
        super(LinuxHostBaseTaskTest, self).setUp()
        self.mock_config_loader = self.mox.CreateMock(DeploymentConfigLoader)

        self.linux_host_base_task = LinuxHostBaseTask()
        self.linux_host_base_task.config_loader = self.mock_config_loader
    def setUp(self):
        super(LinuxHostBaseTaskTest, self).setUp()
        self.mock_config_loader = self.mox.CreateMock(DeploymentConfigLoader)

        self.linux_host_base_task = LinuxHostBaseTask()
        self.linux_host_base_task.config_loader = self.mock_config_loader