def test_athlete_valid_against_schema(self): self.assertTrue( valid_against_schema("sample-jsons/athlete.json", "json/athlete.json")) self.assertTrue( valid_against_schema("sample-jsons/athlete_minimal.json", "json/athlete.json"))
def test_performance_valid_against_schema(self): self.assertTrue( valid_against_schema("sample-jsons/performance.json", "json/performance.json")) self.assertTrue( valid_against_schema("sample-jsons/performance_minimal.json", "json/performance.json"))
def test_invalid_against_metaschema(self): with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/athlete_invalid.json", "json/metaschema.json", expect_failure=True) with self.assertRaises(ValidationError): valid_against_schema( "sample-jsons/combined_performance_invalid.json", "json/metaschema.json", expect_failure=True) with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/competition_invalid.json", "json/metaschema.json", expect_failure=True) with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/event_invalid.json", "json/metaschema.json", expect_failure=True) with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/performance_invalid.json", "json/metaschema.json", expect_failure=True)
def test_competition_valid_against_schema(self): self.assertTrue( valid_against_schema("sample-jsons/competition.json", "json/competition.json")) self.assertTrue( valid_against_schema("sample-jsons/competition_minimal.json", "json/competition.json"))
def test_performance_invalid_against_schema(self): with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/performance_invalid.json", "json/performance.json", expect_failure=True) with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/performance_invalid2.json", "json/performance.json", expect_failure=True)
def test_valid_against_metaschema(self): self.assertTrue( valid_against_schema("sample-jsons/athlete.json", "json/metaschema.json")) self.assertTrue( valid_against_schema("sample-jsons/combined_performance.json", "json/metaschema.json")) self.assertTrue( valid_against_schema("sample-jsons/competition.json", "json/metaschema.json")) self.assertTrue( valid_against_schema("sample-jsons/event.json", "json/metaschema.json")) self.assertTrue( valid_against_schema("sample-jsons/performance.json", "json/metaschema.json"))
def test_race_valid_against_schema(self): self.assertTrue( valid_against_schema( "sample-jsons/race_iffleymiles_2016_600mA.json", "json/race.json")) self.assertTrue( valid_against_schema( "sample-jsons/race_iffleymiles_2016_600mB.json", "json/race.json")) self.assertTrue( valid_against_schema( "sample-jsons/race_iffleymiles_2016_mileA.json", "json/race.json")) self.assertTrue( valid_against_schema( "sample-jsons/race_iffleymiles_2016_mileB.json", "json/race.json"))
def test_race_invalid_against_schema(self): with self.assertRaises(ValidationError): valid_against_schema( "sample-jsons/race_invalid_athlete_internal.json", "json/race.json", expect_failure=True) with self.assertRaises(ValidationError): valid_against_schema( "sample-jsons/race_invalid_athlete_external.json", "json/race.json", expect_failure=True) with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/race_invalid_position.json", "json/race.json", expect_failure=True) with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/race_invalid_result.json", "json/race.json", expect_failure=True)
def test_athlete_invalid_against_schema(self): with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/athlete_invalid.json", "json/athlete.json", expect_failure=True)
def test_event_valid_against_schema(self): self.assertTrue( valid_against_schema("sample-jsons/event.json", "json/event.json")) self.assertTrue( valid_against_schema("sample-jsons/event_minimal.json", "json/event.json"))
def test_competition_invalid_against_schema(self): with self.assertRaises(ValidationError): valid_against_schema("sample-jsons/competition_invalid.json", "json/competition.json", expect_failure=True)