Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Stephan Huber 2018-09-12 11:48:19 +02:00
commit 88596518f5
61 changed files with 2231 additions and 264 deletions

View file

@ -1,7 +1,7 @@
import boto3
import json
# Taken from free tear list when creating an instance
# Taken from free tier list when creating an instance
instances = [
'ami-760aaa0f', 'ami-bb9a6bc2', 'ami-35e92e4c', 'ami-785db401', 'ami-b7e93bce', 'ami-dca37ea5', 'ami-999844e0',
'ami-9b32e8e2', 'ami-f8e54081', 'ami-bceb39c5', 'ami-03cf127a', 'ami-1ecc1e67', 'ami-c2ff2dbb', 'ami-12c6146b',

View file

@ -6,6 +6,9 @@ from botocore.session import Session
import boto3
script_dir = os.path.dirname(os.path.abspath(__file__))
def get_moto_implementation(service_name):
service_name_standardized = service_name.replace("-", "") if "-" in service_name else service_name
if not hasattr(moto, service_name_standardized):
@ -73,20 +76,22 @@ def write_implementation_coverage_to_file(coverage):
except OSError:
pass
for service_name in sorted(coverage):
implemented = coverage.get(service_name)['implemented']
not_implemented = coverage.get(service_name)['not_implemented']
operations = sorted(implemented + not_implemented)
implementation_coverage_file = "{}/../IMPLEMENTATION_COVERAGE.md".format(script_dir)
# rewrite the implementation coverage file with updated values
print("Writing to {}".format(implementation_coverage_file))
with open(implementation_coverage_file, "a+") as file:
for service_name in sorted(coverage):
implemented = coverage.get(service_name)['implemented']
not_implemented = coverage.get(service_name)['not_implemented']
operations = sorted(implemented + not_implemented)
if implemented and not_implemented:
percentage_implemented = int(100.0 * len(implemented) / (len(implemented) + len(not_implemented)))
elif implemented:
percentage_implemented = 100
else:
percentage_implemented = 0
if implemented and not_implemented:
percentage_implemented = int(100.0 * len(implemented) / (len(implemented) + len(not_implemented)))
elif implemented:
percentage_implemented = 100
else:
percentage_implemented = 0
# rewrite the implementation coverage file with updated values
with open("../IMPLEMENTATION_COVERAGE.md", "a+") as file:
file.write("\n")
file.write("## {} - {}% implemented\n".format(service_name, percentage_implemented))
for op in operations: