Files
interop/2016.01/required.py
Catherine Diep 7a020f77da Add 2016.01 required test list.
The required.py and procedure.rst files are copied and updated
from those in the 2015.07 directory.  The new required and
flagged test lists are created based on 2016.01.json

Change-Id: I5df975277c5622a1732d1c5fb76f433f33f0d2b3
2016-02-23 10:38:54 -08:00

40 lines
1.2 KiB
Python
Executable File

import json
required_tests_file = open('2016.01.required.txt', 'w')
flagged_tests_file = open('2016.01.flagged.txt', 'w')
required_tests = []
flagged_tests = []
with open('../2016.01.json', 'r') as capabilities_file:
defcore = json.loads(capabilities_file.read())
capabilities = defcore['capabilities']
for capability_name in capabilities:
capability = capabilities[capability_name]
if capability['required-since'] != '':
tests = capability['tests']
for test_name, test in tests.iteritems():
test_name_id = test_name + "[" + test['idempotent_id'] + "]"
print("test_name_id: %s" % test_name_id)
required_tests.append(test_name_id)
if 'flagged' in test:
flagged_tests.append(test_name_id)
required_tests.sort()
flagged_tests.sort()
# id is now attribute in json, no
# need to lookup id from "...api-test-list.txt"
for rtest in required_tests:
required_tests_file.write(rtest + '\n')
print(rtest)
print("\nflagged\n=======")
for flagged in flagged_tests:
flagged_tests_file.write(flagged + '\n')
print(flagged)
required_tests_file.close()
flagged_tests_file.close()