interop/2015.07/required.py
David Paterson 2d6f8bc983 Add new 2015.07 test requirements list
- Updated required.py to deal with new 2015.07 json schema.
- Created new required and flagged lists based on 2015.07.json.
- Updated procedure doc for 2015.07.

Change-Id: If01d32cd9fbad1a7eb0a5a2ba568aa9314b2dab7
2015-09-22 07:44:47 -04:00

40 lines
1.2 KiB
Python

import json
required_tests_file = open('2015.07.required.txt', 'w')
flagged_tests_file = open('2015.07.flagged.txt', 'w')
required_tests = []
flagged_tests = []
with open('../2015.07.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['status'] == 'required':
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()