def perform_test(schema, data, valid, description): msg = '%s (valid=%r)' % (description, valid) if valid: self.assertTrue(ucl.validate(schema, data), msg) else: with self.assertRaises(ucl.SchemaError): ucl.validate(schema, data) self.fail(msg) # fail() will be called only if SchemaError is not raised
def perform_test(schema, data, valid, description): msg = '%s (valid=%r)' % (description, valid) if valid: self.assertTrue(ucl.validate(schema, data), msg) else: with self.assertRaises(ucl.SchemaError): ucl.validate(schema, data) self.fail( msg ) # fail() will be called only if SchemaError is not raised
def test_validation_useless(self): with self.assertRaises(NotImplementedError): ucl.validate("","")
def test_validation_useless(self): self.assertRaises(NotImplementedError, lambda: ucl.validate("",""))
def perform_test(schema, data, expected): if expected: self.assertTrue(ucl.validate(schema, data)) else: with self.assertRaises(ucl.SchemaError): ucl.validate(schema, data)