예제 #1
0
 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')
예제 #2
0
 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'
예제 #3
0
 def test_validate_for_simple_correct_bundle_succeeds(self):
     with self.assertRaises(StopIteration):
         next(validate(data.bundle('simple')))
예제 #4
0
 def test_validate_for_empty_bundle_fails(self):
     errors = validate(data.bundle('empty'))
     assert isinstance(next(errors), MissingManifestError)
예제 #5
0
파일: cli.py 프로젝트: inab/ro-curate
def main():
    args = parse_arguments()
    for path in args.path:
        for err in api.validate(path):
            print(f'Error: {err}', file=sys.stderr)