summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2013-06-17 21:00:55 -0400
committerJulian Berman <Julian@GrayVines.com>2013-06-17 21:00:55 -0400
commit0a93c5da6f8db71ded773af1d5609c5f2e6ba241 (patch)
tree11fc234df676c78df1777347d76573c3122a149a
parent69b18993aa7e2c630745db80df6392a2f758a52e (diff)
downloadjsonschema-0a93c5da6f8db71ded773af1d5609c5f2e6ba241.tar.gz
Squashed 'json/' changes from 0b8c484..9dc2c40
9dc2c40 Ensure that only RFC3339 datetimes are valid. b4850be Merge pull request #41 from mchiocca/develop c5c9202 Add json-schema (PHP) to the list of who uses the test suite. dfa1985 Remove composer.json. 429b872 Add composer.json file for PHP dependency management. - This allows PHP projects that use Composer to include this project as a required dependency. 4eaaea8 Fix for newer jsonschemas. f61fc0d Make the README not lie. git-subtree-dir: json git-subtree-split: 9dc2c40347a8724163461ab553c0fb1adf812f89
-rw-r--r--README.md6
-rwxr-xr-xbin/jsonschema_suite8
-rw-r--r--tests/draft3/optional/format.json5
-rw-r--r--tests/draft4/optional/format.json5
4 files changed, 19 insertions, 5 deletions
diff --git a/README.md b/README.md
index b375623..03a2c56 100644
--- a/README.md
+++ b/README.md
@@ -52,9 +52,8 @@ they should be valid or invalid.
Coverage
--------
-Currently, draft 3 should have essentially full coverage for the core schema.
-
-The beginnings of draft 4 are underway.
+Draft 3 and 4 should have full coverage. If you see anything missing or think
+there is a useful test missing, please send a pull request or open an issue.
Who Uses the Test Suite
-----------------------
@@ -68,6 +67,7 @@ This suite is being used by:
* [jsonschema (javascript)](https://github.com/tdegrunt/jsonschema)
* [JaySchema (javascript)](https://github.com/natesilva/jayschema)
* [jesse (Erlang)](https://github.com/klarna/jesse)
+ * [json-schema (PHP)](https://github.com/justinrainbow/json-schema)
If you use it as well, please fork and send a pull request adding yourself to
the list :).
diff --git a/bin/jsonschema_suite b/bin/jsonschema_suite
index 9729fc0..96108c8 100755
--- a/bin/jsonschema_suite
+++ b/bin/jsonschema_suite
@@ -32,6 +32,10 @@ try:
import jsonschema
except ImportError:
jsonschema = None
+else:
+ validators = getattr(
+ jsonschema.validators, "validators", jsonschema.validators
+ )
ROOT_DIR = os.path.join(
@@ -138,8 +142,8 @@ class SanityTests(unittest.TestCase):
@unittest.skipIf(jsonschema is None, "Validation library not present!")
def test_all_schemas_are_valid(self):
for schema in os.listdir(SUITE_ROOT_DIR):
- schema_validator = jsonschema.validators.get(schema)
- if schema_validator:
+ schema_validator = validators.get(schema)
+ if schema_validator is not None:
test_files = collect(os.path.join(SUITE_ROOT_DIR, schema))
for case in cases(test_files):
try:
diff --git a/tests/draft3/optional/format.json b/tests/draft3/optional/format.json
index 82f7f13..1ff461a 100644
--- a/tests/draft3/optional/format.json
+++ b/tests/draft3/optional/format.json
@@ -28,6 +28,11 @@
"description": "an invalid date-time string",
"data": "06/19/1963 08:30:06 PST",
"valid": false
+ },
+ {
+ "description": "only RFC3339 not all of ISO 8601 are valid",
+ "data": "2013-350T01:01:01",
+ "valid": false
}
]
},
diff --git a/tests/draft4/optional/format.json b/tests/draft4/optional/format.json
index 2a2f271..cba8fc3 100644
--- a/tests/draft4/optional/format.json
+++ b/tests/draft4/optional/format.json
@@ -12,6 +12,11 @@
"description": "an invalid date-time string",
"data": "06/19/1963 08:30:06 PST",
"valid": false
+ },
+ {
+ "description": "only RFC3339 not all of ISO 8601 are valid",
+ "data": "2013-350T01:01:01",
+ "valid": false
}
]
},