FileAPI test: Add infrastructure for reading JSON test data

This commit is contained in:
Kyle Edwards
2020-02-07 10:58:10 -05:00
parent 3844e2ae4c
commit 1605fcbbd9

View File

@@ -1,8 +1,14 @@
from check_index import *
import json
import sys
import os
def read_codemodel_json_data(filename):
abs_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), "codemodel-v2-data", filename)
with open(abs_filename, "r") as f:
return json.load(f)
def check_objects(o, g):
assert is_list(o)
assert len(o) == 1