def test_resource_string(self): resource_string = utils.resource_string('templates', 'bind9-zone.jinja2') self.assertIsNotNone(resource_string)
def test_resource_string(self): name = ['templates', 'bind9-config.jinja2'] resource_string = utils.resource_string(*name) self.assertIsNotNone(resource_string)
def test_resource_string_missing(self): name = 'invalid.jinja2' with self.assertRaises(exceptions.ResourceNotFound): utils.resource_string(name)
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:])
def test_resource_string_empty_args(self): with testtools.ExpectedException(ValueError): utils.resource_string()
def test_resource_string_missing(self): name = 'invalid.jinja2' with testtools.ExpectedException(exceptions.ResourceNotFound): utils.resource_string(name)
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:])