class TestPrivateTemplateValidator(unittest.TestCase): def setUp(self): self.validator = PrivateTemplateValidator() def test_when_validating_private_template_then_raises_error(self): template = FuncKeyTemplate(private=True) assert_that(calling(self.validator.validate).with_args(template), raises(ResourceError)) def test_when_validating_public_template_then_validation_passes(self): template = FuncKeyTemplate(private=False) self.validator.validate(template)
def setUp(self): self.validator = PrivateTemplateValidator()