Пример #1
0
 def parse_metadata(self, metadata):
     """ Extract design meta-data. """
     meta = Metadata()
     meta.set_name(metadata.get('name'))
     meta.set_license(metadata.get('license'))
     meta.set_owner(metadata.get('owner'))
     meta.set_updated_timestamp(metadata.get('updated_timestamp'))
     meta.set_design_id(metadata.get('design_id'))
     meta.set_description(metadata.get('description'))
     meta.set_slug(metadata.get('slug'))
     for attached_url in metadata.get('attached_urls'):
         meta.add_attached_url(attached_url)
     return meta
Пример #2
0
 def parse_metadata(self, metadata):
     """ Extract design meta-data. """
     meta = Metadata()
     meta.set_name(metadata.get('name'))
     meta.set_license(metadata.get('license'))
     meta.set_owner(metadata.get('owner'))
     meta.set_updated_timestamp(metadata.get('updated_timestamp'))
     meta.set_design_id(metadata.get('design_id'))
     meta.set_description(metadata.get('description'))
     meta.set_slug(metadata.get('slug'))
     for attached_url in metadata.get('attached_urls'):
         meta.add_attached_url(attached_url)
     return meta
 def test_create_new_metadata(self):
     """ Test the creation of a new empty metatdata container. """
     meta = Metadata()
     assert meta.name == ''
 def parse_metadata(self, metadata):
     """ Extract design meta-data. """
     meta = Metadata()
     meta.set_name(metadata.get("name"))
     meta.set_license(metadata.get("license"))
     meta.set_owner(metadata.get("owner"))
     meta.set_updated_timestamp(metadata.get("updated_timestamp"))
     meta.set_design_id(metadata.get("design_id"))
     meta.set_description(metadata.get("description"))
     meta.set_slug(metadata.get("slug"))
     for attached_url in metadata.get("attached_urls"):
         meta.add_attached_url(attached_url)
     return meta