Example #1
0
    def test_resource_string(self):
        resource_string = utils.resource_string('templates',
                                                'bind9-zone.jinja2')

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

        resource_string = utils.resource_string(*name)

        self.assertIsNotNone(resource_string)
Example #3
0
    def test_resource_string_missing(self):
        name = 'invalid.jinja2'

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

        with self.assertRaises(exceptions.ResourceNotFound):
            utils.resource_string(name)
Example #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:])
Example #6
0
 def test_resource_string_empty_args(self):
     with testtools.ExpectedException(ValueError):
         utils.resource_string()
Example #7
0
    def test_resource_string(self):
        name = ['templates', 'bind9-config.jinja2']

        resource_string = utils.resource_string(*name)

        self.assertIsNotNone(resource_string)
Example #8
0
    def test_resource_string_missing(self):
        name = 'invalid.jinja2'

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

        with testtools.ExpectedException(exceptions.ResourceNotFound):
            utils.resource_string(name)
Example #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:])
Example #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:])