Esempio n. 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')
Esempio n. 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'
Esempio n. 3
0
 def test_validate_for_simple_correct_bundle_succeeds(self):
     with self.assertRaises(StopIteration):
         next(validate(data.bundle('simple')))
Esempio n. 4
0
 def test_validate_for_empty_bundle_fails(self):
     errors = validate(data.bundle('empty'))
     assert isinstance(next(errors), MissingManifestError)
Esempio n. 5
0
def main():
    args = parse_arguments()
    for path in args.path:
        for err in api.validate(path):
            print(f'Error: {err}', file=sys.stderr)