Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_storage.py
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | def test_types(self, swh_storage): | ||||
for meth_name in dir(interface): | for meth_name in dir(interface): | ||||
if meth_name.startswith('_'): | if meth_name.startswith('_'): | ||||
continue | continue | ||||
interface_meth = getattr(interface, meth_name) | interface_meth = getattr(interface, meth_name) | ||||
try: | try: | ||||
concrete_meth = getattr(swh_storage, meth_name) | concrete_meth = getattr(swh_storage, meth_name) | ||||
except AttributeError: | except AttributeError: | ||||
if not getattr(interface_meth, 'deprecated_endpoint', False): | |||||
# The backend is missing a (non-deprecated) endpoint | |||||
missing_methods.append(meth_name) | missing_methods.append(meth_name) | ||||
continue | continue | ||||
expected_signature = inspect.signature(interface_meth) | expected_signature = inspect.signature(interface_meth) | ||||
actual_signature = inspect.signature(concrete_meth) | actual_signature = inspect.signature(concrete_meth) | ||||
assert expected_signature == actual_signature, meth_name | assert expected_signature == actual_signature, meth_name | ||||
assert missing_methods == [] | assert missing_methods == [] | ||||
▲ Show 20 Lines • Show All 3,654 Lines • Show Last 20 Lines |