Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_schema_valid_pk_string(self):
filepath = os.path.join(self.data_dir, 'schema_valid_pk_string.json')
with io.open(filepath) as stream:
schema = json.load(stream)
valid, report = table_schema.validate(schema)
self.assertTrue(valid)
def test_schema_valid_full(self):
filepath = os.path.join(self.data_dir, 'schema_valid_full.json')
with io.open(filepath) as stream:
schema = json.load(stream)
valid, report = table_schema.validate(schema)
self.assertTrue(valid)
def test_schema_valid_simple(self):
filepath = os.path.join(self.data_dir, 'schema_valid_simple.json')
with io.open(filepath) as stream:
schema = json.load(stream)
valid, report = table_schema.validate(schema)
self.assertTrue(valid)
def test_schema_invalid_pk_array(self):
filepath = os.path.join(self.data_dir, 'schema_invalid_pk_array.json')
with io.open(filepath) as stream:
schema = json.load(stream)
valid, report = table_schema.validate(schema)
self.assertFalse(valid)
def test_schema_invalid_wrong_type(self):
filepath = os.path.join(self.data_dir, 'schema_invalid_wrong_type.json')
with io.open(filepath) as stream:
schema = json.load(stream)
valid, report = table_schema.validate(schema)
self.assertFalse(valid)
def test_schema_invalid_empty(self):
filepath = os.path.join(self.data_dir, 'schema_invalid_empty.json')
with io.open(filepath) as stream:
schema = json.load(stream)
valid, report = table_schema.validate(schema)
self.assertFalse(valid)
def test_schema_invalid_pk_string(self):
filepath = os.path.join(self.data_dir, 'schema_invalid_pk_string.json')
with io.open(filepath) as stream:
schema = json.load(stream)
valid, report = table_schema.validate(schema)
self.assertFalse(valid)
def test_schema_valid_pk_array(self):
filepath = os.path.join(self.data_dir, 'schema_valid_pk_array.json')
with io.open(filepath) as stream:
schema = json.load(stream)
valid, report = table_schema.validate(schema)
self.assertTrue(valid)