def update_tests(): db = database() for filepath in TESTS_DIR.walkfiles('*.json'): with open(filepath) as f: print "Reading {0}".format(filepath) data = f.read() json_dict = json.loads(data) db['tests'].update({'name': json_dict['name']}, json_dict, upsert=True)
def make_tests_devices(): for filepath in TESTS_DIR.files('*.json'): print "Reading {0}".format(filepath) with open(filepath) as f: test_dict = json.loads(f.read()) make_tests_device(test_dict)