def test_validate_fails_when_not_conforming_to_remote(self): errors = validate(data.bundle('cwlprofile')) err = next(errors) assert isinstance(err, ConstraintViolationError) self.assertEqual(err.message, 'RO does not have a homepage')
def test_validate_fails_when_not_conforming_to_profile(self): errors = validate(data.bundle('fails-against-profile')) err = next(errors) assert isinstance(err, ConstraintViolationError) assert err.message == 'RO does not conform'
def test_validate_for_simple_correct_bundle_succeeds(self): with self.assertRaises(StopIteration): next(validate(data.bundle('simple')))
def test_validate_for_empty_bundle_fails(self): errors = validate(data.bundle('empty')) assert isinstance(next(errors), MissingManifestError)
def main(): args = parse_arguments() for path in args.path: for err in api.validate(path): print(f'Error: {err}', file=sys.stderr)