예제 #1
0
def test_deployment_parsing():
    my_connect = client.from_config(CONFIG)
    assert my_connect.host == "localhost"
    assert my_connect.port == "9030"
    assert my_connect.protocol == "http"
    assert my_connect.base_path == ""
    assert my_connect.tamr_username == "my_user"
    assert my_connect.tamr_password == "my_password"
예제 #2
0
def test_oracle_parsing():
    my_connect = client.from_config(
        CONFIG_MULTI_EXPORT,
        jdbc_key="oracle",
    )
    assert my_connect.jdbc_info.jdbc_url == "jdbc::oracle_db"
    assert my_connect.jdbc_info.db_user == "oracle_user"
    assert my_connect.jdbc_info.db_password == "oracle_pw"
예제 #3
0
def test_postgres_parsing():
    my_connect = client.from_config(
        CONFIG_MULTI_EXPORT,
        jdbc_key="postgres",
    )
    assert my_connect.jdbc_info.jdbc_url == "jdbc::postgres_db"
    assert my_connect.jdbc_info.db_user == "postgres_user"
    assert my_connect.jdbc_info.db_password == "postgres_pw"
예제 #4
0
def test_get_query_config_from_ingest():
    my_connect = client.from_config(CONFIG)
    ingest_info = my_connect.jdbc_info
    query_config = client._get_query_config(ingest_info)
    assert query_config["jdbcUrl"] == ingest_info.jdbc_url
    assert query_config["dbUsername"] == ingest_info.db_user
    assert query_config["dbPassword"] == ingest_info.db_password
    assert query_config["fetchSize"] == ingest_info.fetch_size
예제 #5
0
def test_local_fs_avro_schema_export():
    my_export_connect = client.from_config(CONFIG)
    assert client.export_dataset_avro_schema(
        my_export_connect,
        url="/home/ubuntu/connect_export/schema/people_tiny.avsc",
        dataset_name="people_tiny.csv",
        fs_type=FileSystemType.LOCAL,
    )
예제 #6
0
def test_export():
    my_export_connect = client.from_config(CONFIG)
    assert client.export_dataset(
        my_export_connect,
        dataset_name="test_df_connect",
        target_table_name="test",
        truncate_before_load=True,
    )
예제 #7
0
def test_ingest_set_pk():
    my_ingest_connect = client.from_config(CONFIG)
    assert client.ingest_dataset(
        my_ingest_connect,
        dataset_name="test_df_connect_2",
        query="select * from dataset.dataset_ns_current limit 1",
        primary_key="id",
    )
예제 #8
0
def test_ingest():
    my_ingest_connect = client.from_config(CONFIG)
    print(my_ingest_connect)
    assert client.ingest_dataset(
        my_ingest_connect,
        dataset_name="test_df_connect",
        query="select * from dataset.dataset_ns_current limit 1",
    )
예제 #9
0
def test_profile():
    my_profile_connect = client.from_config(CONFIG)
    assert client.profile_query_results(
        my_profile_connect,
        dataset_name="test_df_connect_profile",
        queries=[
            "select * from dataset.dataset_ns_current limit 100",
            "select * from dataset.attribute_ns_current limit 100",
        ],
    )
예제 #10
0
def test_get_url_https():
    my_ssl_connect = client.from_config(CONFIG_HTTPS)
    assert (client._get_url(
        my_ssl_connect,
        "/api/jdbcIngest") == "https://localhost/df_connect/api/jdbcIngest")
예제 #11
0
def test_get_url_http():
    my_connect = client.from_config(CONFIG)
    assert client._get_url(
        my_connect,
        "/api/jdbcIngest") == "http://localhost:9030/api/jdbcIngest"
예제 #12
0
def test_https_deployment_processing():
    my_connect = client.from_config(CONFIG_HTTPS)
    assert my_connect.protocol == "https"
    assert my_connect.port == ""
    assert my_connect.base_path == "df_connect"
예제 #13
0
def test_jdbc_parsing():
    my_connect = client.from_config(CONFIG)
    assert my_connect.jdbc_info.jdbc_url == "tamr::jdbc_ingest"
    assert my_connect.jdbc_info.db_user == "ingest_user"
    assert my_connect.jdbc_info.db_password == "ingest_pw"
    assert my_connect.jdbc_info.fetch_size == 10000
예제 #14
0
def test_execute():
    my_export_connect = client.from_config(CONFIG)
    assert client.execute_statement(my_export_connect, "select * from test")