Skip to content

Commit

Permalink
fixes jsonschema test
Browse files Browse the repository at this point in the history
  • Loading branch information
nesaro committed Oct 30, 2014
1 parent 2c1f157 commit f87d9e4
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/unit/test_Checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,18 @@ def testCheck(self):
from pydsl.Grammar.Definition import JsonSchema
from pydsl.Check import JsonSchemaChecker
schema = {
"type" : "string",
"items" : {
"type" : ["string", "object"],
"type" : "object",
"required":["foo"],
"properties" : {
"foo" : {"enum" : [1, 3]},
#"bar" : { #See https://github.com/Julian/jsonschema/issues/89
# "type" : "array",
# "properties" : {
# "bar" : {"required" : True},
# "baz" : {"minItems" : 2},
# }
#}
}
}
}
grammardef = JsonSchema(schema)
checker = JsonSchemaChecker(grammardef)
self.assertTrue(checker.check("a"))
self.assertFalse(checker.check("a"))
self.assertTrue(checker.check({"foo":1}))
self.assertFalse(checker.check({"foo":2}))
self.assertTrue(checker.check({"foo":3}))
self.assertFalse(checker.check([1, {"foo" : 2, "bar" : {"baz" : [1]}}, "quux"]))


Expand Down

0 comments on commit f87d9e4

Please sign in to comment.