Ejemplo n.º 1
0
    def test_load_template_keep_trailing_newline(self, mock_resource_string):
        mock_resource_string.return_value = 'Hello {{name}}'.encode('utf-8')

        template = utils.load_template('bind9-zone.jinja2')

        self.assertTrue(template.environment.keep_trailing_newline)
Ejemplo n.º 2
0
    def test_load_template_missing(self):
        name = 'invalid.jinja2'

        with self.assertRaises(exceptions.ResourceNotFound):
            utils.load_template(name)
Ejemplo n.º 3
0
    def test_load_template(self, mock_resource_string):
        mock_resource_string.return_value = 'Hello {{name}}'.encode('utf-8')

        template = utils.load_template('bind9-zone.jinja2')

        self.assertIsInstance(template, jinja2.Template)
Ejemplo n.º 4
0
    def test_load_template_missing(self):
        name = 'invalid.jinja2'

        with self.assertRaises(exceptions.ResourceNotFound):
            utils.load_template(name)
Ejemplo n.º 5
0
    def test_load_template(self):
        name = 'bind9-config.jinja2'

        template = utils.load_template(name)

        self.assertIsInstance(template, Template)
Ejemplo n.º 6
0
    def test_load_template(self):
        name = 'bind9-config.jinja2'

        template = utils.load_template(name)

        self.assertIsInstance(template, Template)
Ejemplo n.º 7
0
    def test_load_template_missing(self):
        name = 'invalid.jinja2'

        with testtools.ExpectedException(exceptions.ResourceNotFound):
            utils.load_template(name)
Ejemplo n.º 8
0
 def test_load_template_keep_trailing_newline(self):
     name = 'bind9-zone.jinja2'
     template = utils.load_template(name)
     self.assertTrue(template.environment.keep_trailing_newline)
Ejemplo n.º 9
0
    def test_load_template_missing(self):
        name = 'invalid.jinja2'

        with testtools.ExpectedException(exceptions.ResourceNotFound):
            utils.load_template(name)
Ejemplo n.º 10
0
 def test_load_template_keep_trailing_newline(self):
     name = 'bind9-zone.jinja2'
     template = utils.load_template(name)
     self.assertTrue(template.environment.keep_trailing_newline)