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

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

        resource_string = utils.resource_string(*name)

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

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

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

        resource_string = utils.resource_string(*name)

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

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

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