Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jhilgart committed Apr 15, 2024
1 parent 8bb9a4f commit d2421e0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions semantic_model_generator/tests/generate_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ def mock_dependencies(mock_snowflake_connection):
]

with patch(
"semantic_model_generator.main.get_valid_schemas_tables_columns_df",
"semantic_model_generator.generate_model.get_valid_schemas_tables_columns_df",
side_effect=valid_schemas_tables_representations,
), patch(
"semantic_model_generator.main.get_table_representation",
"semantic_model_generator.generate_model.get_table_representation",
side_effect=table_representations,
):
yield
Expand All @@ -146,11 +146,11 @@ def test_raw_schema_to_semantic_context(
want_yaml = "name: this is the best semantic model ever\ntables:\n - name: ALIAS\n description: ' '\n base_table:\n database: test_db\n schema: schema_test\n table: ALIAS\n filters:\n - name: ' '\n synonyms:\n - ' '\n description: ' '\n expr: ' '\n dimensions:\n - name: ZIP_CODE\n synonyms:\n - ' '\n description: ' '\n expr: ZIP_CODE\n data_type: TEXT\n time_dimensions:\n - name: BAD_ALIAS\n synonyms:\n - ' '\n description: ' '\n expr: BAD_ALIAS\n data_type: TIMESTAMP\n measures:\n - name: AREA_CODE\n synonyms:\n - ' '\n description: ' '\n expr: AREA_CODE\n data_type: NUMBER\n - name: CBSA\n synonyms:\n - ' '\n description: ' '\n expr: CBSA\n data_type: NUMBER\n"

snowflake_account = "test_account"
fqn_tables = ["test_db.schema_test.ALIAS"]
physical_tables = ["test_db.schema_test.ALIAS"]
semantic_model_name = "this is the best semantic model ever"

semantic_model = raw_schema_to_semantic_context(
fqn_tables=fqn_tables,
physical_tables=physical_tables,
snowflake_account=snowflake_account,
semantic_model_name=semantic_model_name,
)
Expand Down Expand Up @@ -180,13 +180,13 @@ def test_generate_base_context_with_placeholder_comments(
mock_snowflake_connection_env,
):

fqn_tables = ["test_db.schema_test.ALIAS"]
physical_tables = ["test_db.schema_test.ALIAS"]
snowflake_account = "test_account"
output_path = "output_model_path.yaml"
semantic_model_name = "my awesome semantic model"

generate_base_semantic_context_from_snowflake(
fqn_tables=fqn_tables,
physical_tables=physical_tables,
snowflake_account=snowflake_account,
output_yaml_path=output_path,
semantic_model_name=semantic_model_name,
Expand All @@ -207,7 +207,7 @@ def test_generate_base_context_with_placeholder_comments_cross_database_cross_sc
mock_snowflake_connection_env,
):

fqn_tables = [
physical_tables = [
"test_db.schema_test.ALIAS",
"a_different_database.a_different_schema.PRODUCTS",
]
Expand All @@ -216,7 +216,7 @@ def test_generate_base_context_with_placeholder_comments_cross_database_cross_sc
semantic_model_name = "Another Incredible Semantic Model"

generate_base_semantic_context_from_snowflake(
fqn_tables=fqn_tables,
physical_tables=physical_tables,
snowflake_account=snowflake_account,
output_yaml_path=output_path,
semantic_model_name=semantic_model_name,
Expand Down

0 comments on commit d2421e0

Please sign in to comment.