def test_template_services(self, template_services_mock): """Check obtaining the template description with services.""" fixture_apps = self.useFixture(et.ApplicationsFixture()) fixture_env_apps = self.useFixture(et.AppEnvTemplateFixture()) template_services_mock.get_description.return_value = \ fixture_env_apps.env_template_desc template_des = self.core_services.get_template_data('any', '/services') self.assertEqual(fixture_apps.applications_desc, template_des) template_services_mock.get_description.assert_called_with('any')
def test_adding_services(self, template_services_mock): """Check adding services to a template.""" ftomcat = self.useFixture(et.ApplicationTomcatFixture()) fmysql = self.useFixture(et.ApplicationMysqlFixture()) fixture = self.useFixture(et.EmptyEnvironmentTemplateFixture()) fservices = self.useFixture(et.ApplicationsFixture()) template_services_mock.get_description.return_value =\ fixture.environment_template_desc self.core_services.\ post_env_template_data('any', ftomcat.application_tomcat_desc, '/services') self.core_services.\ post_env_template_data('any', fmysql.application_mysql_desc, '/services') template_des = \ self.core_services.get_template_data('any', '/services') self.assertEqual(fservices.applications_desc, template_des) template_services_mock.get_description.assert_called_with('any')