fixes spulec/moto#1673 and updated IMPLEMENTATION_COVERAGE.md

This commit is contained in:
Stephan Huber 2018-06-14 09:10:06 +02:00
commit 6e269d1e31
2 changed files with 43 additions and 42 deletions

View file

@ -7,12 +7,13 @@ import boto3
def get_moto_implementation(service_name):
if not hasattr(moto, service_name):
service_name_standardized = service_name.replace("-", "") if "-" in service_name else service_name
if not hasattr(moto, service_name_standardized):
return None
module = getattr(moto, service_name)
module = getattr(moto, service_name_standardized)
if module is None:
return None
mock = getattr(module, "mock_{}".format(service_name))
mock = getattr(module, "mock_{}".format(service_name_standardized))
if mock is None:
return None
backends = list(mock().backends.values())