Exemple #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
Exemple #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
Exemple #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
Exemple #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)
Exemple #5
0
 def dummy_get_new_mapping(tenant, datacenter):
     file_path = get_absolue_path(input_file)
     x = parse_json_file(file_path)
     return x
Exemple #6
0
def get_data_str(file_name):
    return json.dumps(parse_json_file(get_absolue_path(file_name)))
Exemple #7
0
def get_data_json(file_name):
    return parse_json_file(get_absolue_path(file_name))
Exemple #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)