Skip to content

Commit

Permalink
tests: added failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
doctrino committed Dec 8, 2024
1 parent 1782e87 commit 5304cf7
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,34 @@ def test_replace_not_preserve_type(self) -> None:

assert result == "dataset_id('ds_external_id')"

def test_replace_sql_preserve_double_quotes(self) -> None:
source_yaml = """externalId: some_id
name: Some Transformation
destination:
type: nodes
view:
space: cdf_cdm
externalId: CogniteTimeSeries
version: v1
instanceSpace: my_instance_space
query: >-
select "fpso_{{location_id}}" as externalId, "{{location_ID}}" as uid, "{{location_ID}}" as description
"""
variables = BuildVariables.load_raw(
{
"location_id": "uny",
"location_ID": "UNY",
},
available_modules=set(),
selected_modules=set(),
)

result = variables.replace(source_yaml, file_suffix=".yaml")

loaded = yaml.safe_load(result)

assert loaded["query"] == 'select "fpso_uny" as externalId, "UNY" as uid, "UNY" as description\n'

def test_get_module_variables_variable_preference_order(self) -> None:
source_yaml = """
modules:
Expand Down

0 comments on commit 5304cf7

Please sign in to comment.