Ejemplo n.º 1
0
    def test_resource_string(self):
        resource_string = utils.resource_string('templates',
                                                'bind9-zone.jinja2')

        self.assertIsNotNone(resource_string)
Ejemplo n.º 2
0
    def test_resource_string(self):
        name = ['templates', 'bind9-config.jinja2']

        resource_string = utils.resource_string(*name)

        self.assertIsNotNone(resource_string)
Ejemplo n.º 3
0
    def test_resource_string_missing(self):
        name = 'invalid.jinja2'

        with self.assertRaises(exceptions.ResourceNotFound):
            utils.resource_string(name)
Ejemplo n.º 4
0
    def test_resource_string_missing(self):
        name = 'invalid.jinja2'

        with self.assertRaises(exceptions.ResourceNotFound):
            utils.resource_string(name)
Ejemplo n.º 5
0
 def test_bind9_zone_ends_with_empty_line(self):
     name = ['templates', 'bind9-zone.jinja2']
     resource_string = utils.resource_string(*name)
     self.assertEqual(b'\n\n', resource_string[-2:])
Ejemplo n.º 6
0
 def test_resource_string_empty_args(self):
     with testtools.ExpectedException(ValueError):
         utils.resource_string()
Ejemplo n.º 7
0
    def test_resource_string(self):
        name = ['templates', 'bind9-config.jinja2']

        resource_string = utils.resource_string(*name)

        self.assertIsNotNone(resource_string)
Ejemplo n.º 8
0
    def test_resource_string_missing(self):
        name = 'invalid.jinja2'

        with testtools.ExpectedException(exceptions.ResourceNotFound):
            utils.resource_string(name)
Ejemplo n.º 9
0
 def test_resource_string_empty_args(self):
     with testtools.ExpectedException(ValueError):
         utils.resource_string()
Ejemplo n.º 10
0
    def test_resource_string_missing(self):
        name = 'invalid.jinja2'

        with testtools.ExpectedException(exceptions.ResourceNotFound):
            utils.resource_string(name)
Ejemplo n.º 11
0
 def test_bind9_zone_ends_with_empty_line(self):
     name = ['templates', 'bind9-zone.jinja2']
     resource_string = utils.resource_string(*name)
     self.assertEqual(b'\n\n', resource_string[-2:])
Ejemplo n.º 12
0
 def test_bind9_zone_ends_with_empty_line(self):
     name = ["templates", "bind9-zone.jinja2"]
     resource_string = utils.resource_string(*name)
     self.assertEqual("\n\n", resource_string[-2:])