コード例 #1
0
 def dummy_select_query(self, connection, table_name, primary_key={}):
     file_path = get_absolue_path(expected_file)
     x = parse_json_file(file_path)
     if formator:
         format(x)
     else:
         return x
コード例 #2
0
def verify_mapping(actual_output, expected_file):
    file = get_absolue_path(expected_file)
    expected_json = parse_json_file(file)
    actual_output = ''.join(actual_output)
    actual_output = json.loads(actual_output)
    if actual_output == expected_json:
        return True
    else:
        return False
コード例 #3
0
def generate_multiple_dummy_db_output(formator, expected_files):
    db_outputs = []
    for file in expected_files:
        file_path = get_absolue_path(file)
        x = parse_json_file(file_path)
        if formator:
            db_outputs.append(formator(x))
        else:
            db_outputs.append(x)
    cnt = 0
    print('=== {}'.format(db_outputs))
    while cnt < len(db_outputs):
        yield db_outputs[cnt]
        cnt = cnt + 1
コード例 #4
0
def verify_change_key(actual_output, expected_file):
    file = get_absolue_path(expected_file)
    expected_output = parse_json_file(file)
    return compare_obj_list(actual_output, expected_output)
コード例 #5
0
 def dummy_get_new_mapping(tenant, datacenter):
     file_path = get_absolue_path(input_file)
     x = parse_json_file(file_path)
     return x
コード例 #6
0
def get_data_str(file_name):
    return json.dumps(parse_json_file(get_absolue_path(file_name)))
コード例 #7
0
def get_data_json(file_name):
    return parse_json_file(get_absolue_path(file_name))
コード例 #8
0
def verify_agent_status(actual_output, expected_file):
    file = get_absolue_path(expected_file)
    expected_output = parse_json_file(file)
    return compare_dicts(actual_output, expected_output)