Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def validate_item_link_type(href, link_type, should_include_self):
item_dict = STAC_IO.read_json(href)
item = STACObject.from_file(href)
for link in item.get_links():
if not link.rel == 'self':
self.assertEqual(link.link_type, link_type)
rels = set([l['rel'] for l in item_dict['links']])
self.assertEqual('self' in rels, should_include_self)
def validate_file(self, path, object_type):
d = STAC_IO.read_json(path)
return self.schema_validator.validate_dict(d, object_type)