コード例 #1
0
def test_arc_map_server_generate_sql_extra(arc_map_server):
    map_server = arc_map_server
    sql = map_server.generate_sql_extra()

    save_test_to_file("arc_map_server_generate_sql_extra.txt", sql)
    sql_expected = get_generated_sql_expected("arc_map_server_generate_sql_extra.txt")

    assert sql.replace("\n", '').replace("\r", "").replace("\t", '').strip() \
           == sql_expected.replace("\n", '').replace("\r", "").replace("\t", '').strip()

    # sql_parse = f"SET PARSEONLY ON;\r\nGO\r\n{sql}SET PARSEONLY OFF;"
    try:
        map_server.db_client.exec_non_query(sql)
    except:
        assert False
コード例 #2
0
def test_arc_service_generate_sql_preamble(db_type, arc_service):
    service = arc_service
    sql = service.generate_sql_preamble()

    save_test_to_file(f"arc_service_generate_sql_preamble_{db_type}.sql", sql)
    sql_expected = get_generated_sql_expected(
        f"arc_service_generate_sql_preamble_{db_type}.sql")

    assert sql.replace("\n", '').replace("\r", "").replace("\t", '').strip() \
           == sql_expected.replace("\n", '').replace("\r", "").replace("\t", '').strip()

    # sql_parse = f"SET PARSEONLY ON;\r\nGO\r\n{sql}SET PARSEONLY OFF;"
    try:
        service.db_client.exec_non_query(sql)
    except:
        assert False
コード例 #3
0
def test_arc_rest_model_generate_sql(arc_rest_model):
    service = arc_rest_model
    sql = service.generate_sql()

    save_test_to_file(
        f"{arc_rest_model.db_client.name}_arc_service_generate_sql.sql", sql)
    sql_expected = get_generated_sql_expected(
        f"{arc_rest_model.db_client.name}_arc_service_generate_sql.sql")

    assert sql.replace("\n", '').replace("\r", "").replace("\t", '').strip() \
           == sql_expected.replace("\n", '').replace("\r", "").replace("\t", '').strip()

    # sql_parse = f"SET PARSEONLY ON;\r\nGO\r\n{sql}SET PARSEONLY OFF;"
    try:
        service.db_client.exec_non_query(sql)
    except:
        assert False