2018-03-27 14:30:46 -04:00
|
|
|
"""The unittest.TestCase for JSON Schema tests."""
|
2017-07-31 18:14:18 -04:00
|
|
|
|
2018-03-08 11:58:41 -05:00
|
|
|
from buildscripts.resmokelib.testing.testcases import jsrunnerfile
|
2017-07-31 18:14:18 -04:00
|
|
|
|
2017-09-01 17:40:29 -04:00
|
|
|
|
2018-03-08 11:58:41 -05:00
|
|
|
class JSONSchemaTestCase(jsrunnerfile.JSRunnerFileTestCase):
|
|
|
|
|
"""A JSON Schema test to execute."""
|
2017-07-31 18:14:18 -04:00
|
|
|
|
|
|
|
|
REGISTERED_NAME = "json_schema_test"
|
|
|
|
|
|
2018-03-26 11:25:04 -04:00
|
|
|
def __init__(self, logger, json_filename, shell_executable=None, shell_options=None):
|
2018-03-27 14:30:46 -04:00
|
|
|
"""Initialize the JSONSchemaTestCase with the JSON test file."""
|
2017-07-31 18:14:18 -04:00
|
|
|
|
2018-03-08 11:58:41 -05:00
|
|
|
jsrunnerfile.JSRunnerFileTestCase.__init__(
|
2018-03-26 11:25:04 -04:00
|
|
|
self, logger, "JSON Schema test", json_filename,
|
2018-03-08 11:58:41 -05:00
|
|
|
test_runner_file="jstests/libs/json_schema_test_runner.js",
|
2018-03-26 11:25:04 -04:00
|
|
|
shell_executable=shell_executable, shell_options=shell_options)
|
2017-07-31 18:14:18 -04:00
|
|
|
|
2018-03-08 11:58:41 -05:00
|
|
|
@property
|
|
|
|
|
def json_filename(self):
|
2018-03-27 14:30:46 -04:00
|
|
|
"""Get the JSON filename."""
|
2018-03-08 11:58:41 -05:00
|
|
|
return self.test_name
|
2017-07-31 18:14:18 -04:00
|
|
|
|
2018-03-08 11:58:41 -05:00
|
|
|
def _populate_test_data(self, test_data):
|
2017-07-31 18:14:18 -04:00
|
|
|
test_data["jsonSchemaTestFile"] = self.json_filename
|
2019-09-16 18:17:40 +00:00
|
|
|
test_data["peerPids"] = self.fixture.pids()
|