-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added unit test for uniqueness, fixed quoting bug
- Loading branch information
kevin
committed
Jan 1, 2024
1 parent
1b858a3
commit c878026
Showing
4 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
integration_tests/tests/generate_uniqueness_tests/uniqueness_colnames_with_spaces.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
|
||
{% set actual_yaml = toyaml(fromjson(tojson( | ||
testgen.get_uniqueness_test_suggestions( | ||
ref('colnames_with_spaces'), | ||
compound_key_length = 1 | ||
) | ||
))) | ||
%} | ||
|
||
{% set expected_yaml %} | ||
models: | ||
- name: colnames_with_spaces | ||
columns: | ||
- name: First Name | ||
description: Uniqueness test generated by dbt-testgen | ||
tests: | ||
- unique | ||
- not_null | ||
- name: Age (Years) | ||
description: Uniqueness test generated by dbt-testgen | ||
tests: | ||
- unique | ||
- not_null | ||
- name: Current City | ||
description: Uniqueness test generated by dbt-testgen | ||
tests: | ||
- unique | ||
- not_null | ||
{% endset %} | ||
|
||
{{ assert_equal (actual_yaml | trim, expected_yaml | trim) }} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters