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"
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"
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"
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
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, )
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, )
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", )
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", )
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", ], )
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")
def test_get_url_http(): my_connect = client.from_config(CONFIG) assert client._get_url( my_connect, "/api/jdbcIngest") == "http://localhost:9030/api/jdbcIngest"
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"
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
def test_execute(): my_export_connect = client.from_config(CONFIG) assert client.execute_statement(my_export_connect, "select * from test")