Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/storage/test_storage.py
Show First 20 Lines • Show All 846 Lines • ▼ Show 20 Lines | class CommonTestStorage: | ||||
# content_fossology_license tests | # content_fossology_license tests | ||||
( | ( | ||||
_, # The endpoint content_fossology_license_missing does not exist | _, # The endpoint content_fossology_license_missing does not exist | ||||
# the following tests are disabled because fossology_license tests | # the following tests are disabled because fossology_license tests | ||||
# behave differently | # behave differently | ||||
_, # test_content_fossology_license_add__drop_duplicate, | _, # test_content_fossology_license_add__drop_duplicate, | ||||
_, # test_content_fossology_license_add__update_in_place_duplicate, | _, # test_content_fossology_license_add__update_in_place_duplicate, | ||||
_, # test_content_fossology_license_add__update_in_place_deadlock, | _, # test_content_fossology_license_add__update_in_place_deadlock, | ||||
_, # test_content_metadata_add__duplicate_twice, | _, # test_content_fossology_license_add__duplicate_twice, | ||||
_, # test_content_fossology_license_get, | _, # test_content_fossology_license_get, | ||||
_, # test_content_fossology_license_delete, | _, # test_content_fossology_license_delete, | ||||
_, # test_content_fossology_license_delete_nonexisting, | _, # test_content_fossology_license_delete_nonexisting, | ||||
) = gen_generic_endpoint_tests( | ) = gen_generic_endpoint_tests( | ||||
endpoint_type='content_fossology_license', | endpoint_type='content_fossology_license', | ||||
tool_name='nomos', | tool_name='nomos', | ||||
example_data1={ | example_data1={ | ||||
'licenses': ['Apache-2.0'], | 'licenses': ['Apache-2.0'], | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | def test_content_fossology_license_add__new_license_added(self): | ||||
'licenses': ['Apache-2.0', 'BSD-2-Clause'], | 'licenses': ['Apache-2.0', 'BSD-2-Clause'], | ||||
'tool': tool | 'tool': tool | ||||
}] | }] | ||||
} | } | ||||
# license did not change as the v2 was dropped. | # license did not change as the v2 was dropped. | ||||
self.assertEqual(actual_licenses, [expected_license]) | self.assertEqual(actual_licenses, [expected_license]) | ||||
# content_metadata tests | |||||
( | |||||
test_content_metadata_missing, | |||||
test_content_metadata_add__drop_duplicate, | |||||
test_content_metadata_add__update_in_place_duplicate, | |||||
test_content_metadata_add__update_in_place_deadlock, | |||||
test_content_metadata_add__duplicate_twice, | |||||
test_content_metadata_get, | |||||
_, # test_content_metadata_delete, | |||||
_, # test_content_metadata_delete_nonexisting, | |||||
) = gen_generic_endpoint_tests( | |||||
endpoint_type='content_metadata', | |||||
tool_name='swh-metadata-detector', | |||||
example_data1={ | |||||
'metadata': { | |||||
'other': {}, | |||||
'codeRepository': { | |||||
'type': 'git', | |||||
'url': 'https://github.com/moranegg/metadata_test' | |||||
}, | |||||
'description': 'Simple package.json test for indexer', | |||||
'name': 'test_metadata', | |||||
'version': '0.0.1' | |||||
}, | |||||
}, | |||||
example_data2={ | |||||
'metadata': { | |||||
'other': {}, | |||||
'name': 'test_metadata', | |||||
'version': '0.0.1' | |||||
}, | |||||
}, | |||||
) | |||||
# revision_intrinsic_metadata tests | # revision_intrinsic_metadata tests | ||||
( | ( | ||||
test_revision_intrinsic_metadata_missing, | test_revision_intrinsic_metadata_missing, | ||||
test_revision_intrinsic_metadata_add__drop_duplicate, | test_revision_intrinsic_metadata_add__drop_duplicate, | ||||
test_revision_intrinsic_metadata_add__update_in_place_duplicate, | test_revision_intrinsic_metadata_add__update_in_place_duplicate, | ||||
test_revision_intrinsic_metadata_add__update_in_place_deadlock, | test_revision_intrinsic_metadata_add__update_in_place_deadlock, | ||||
test_revision_intrinsic_metadata_add__duplicate_twice, | test_revision_intrinsic_metadata_add__duplicate_twice, | ||||
test_revision_intrinsic_metadata_get, | test_revision_intrinsic_metadata_get, | ||||
▲ Show 20 Lines • Show All 1,033 Lines • Show Last 20 Lines |