def test_Package_creation_and_dump(self): package = models.AndroidApp(name='someAndroidPAcakge') expected = [ ('type', u'android'), ('namespace', None), ('name', u'someAndroidPAcakge'), ('version', None), ('qualifiers', {}), ('subpath', None), ('primary_language', u'Java'), ('description', None), ('release_date', None), ('parties', []), ('keywords', []), ('homepage_url', None), ('download_url', None), ('size', None), ('sha1', None), ('md5', None), ('sha256', None), ('sha512', None), ('bug_tracking_url', None), ('code_view_url', None), ('vcs_url', None), ('copyright', None), ('license_expression', None), ('declared_license', None), ('notice_text', None), ('root_path', None), ('dependencies', []), ('contains_source_code', None), ('source_packages', []), ('extra_data', {}), ('purl', u'pkg:android/someAndroidPAcakge'), ('repository_homepage_url', None), ('repository_download_url', None), ('api_data_url', None), ] assert list(package.to_dict().items()) == expected
def test_model_creation_and_dump(self): package = models.AndroidApp(name='someAndroidPAcakge') expected = [('type', u'Android app'), ('name', u'someAndroidPAcakge'), ('version', None), ('primary_language', u'Java'), ('packaging', u'archive'), ('summary', None), ('description', None), ('payload_type', None), ('size', None), ('release_date', None), ('authors', []), ('maintainers', []), ('contributors', []), ('owners', []), ('packagers', []), ('distributors', []), ('vendors', []), ('keywords', []), ('keywords_doc_url', None), ('metafile_locations', []), ('metafile_urls', []), ('homepage_url', None), ('notes', None), ('download_urls', []), ('download_sha1', None), ('download_sha256', None), ('download_md5', None), ('bug_tracking_url', None), ('support_contacts', []), ('code_view_url', None), ('vcs_tool', None), ('vcs_repository', None), ('vcs_revision', None), ('copyright_top_level', None), ('copyrights', []), ('asserted_licenses', []), ('legal_file_locations', []), ('license_expression', None), ('license_texts', []), ('notice_texts', []), ('dependencies', {}), ('related_packages', [])] assert expected == package.to_dict().items() package.validate()