-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement simple unit test using fixtures
- Loading branch information
Maria Lorena Rodriguez Viruel
committed
Aug 21, 2024
1 parent
b4ecea6
commit 889c50f
Showing
11 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
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
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,16 @@ | ||
unit_tests: | ||
- name: test_document_metadata | ||
description: | | ||
This unit test validates the transformation logic in the `document_metadata` model | ||
for the first test scenario, ensuring that the input data from `source_table` is correctly transformed. | ||
model: document_metadata | ||
overrides: | ||
macros: | ||
is_incremental: false | ||
given: | ||
- input: ref('test_source_table') | ||
format: csv | ||
fixture: contacts_test_source_table_input | ||
expect: | ||
format: csv | ||
fixture: contacts_document_metadata_input |
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,7 @@ | ||
{{ config(materialized='table') }} | ||
|
||
select | ||
null::timestamp as saved_timestamp, | ||
null::text as _id, | ||
null::boolean as _deleted, | ||
null::jsonb as doc |
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
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
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,5 @@ | ||
uuid,_deleted,saved_timestamp,doc_type | ||
"1",false,"2024-08-01 00:00:00.000","person" | ||
"2",false,"2024-08-01 00:00:00.000","person" | ||
"3",false,"2024-08-02 00:00:00.000","clinic" | ||
"4",true,"2024-08-02 00:00:00.000","person" |
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,3 @@ | ||
uuid,name,phone,phone2,active,notes,contact_id,muted,parent_uuid,reported | ||
"1","John Doe","1234567890","0987654321",true,"Test note","C123",false,"parent1","2021-08-01 00:00:00" | ||
"2","Jane Doe","1234567890","0987654321",false,"Another note","C124",false,"parent2","2021-08-01 00:00:00" |
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,5 @@ | ||
saved_timestamp,_id,_deleted,doc | ||
"2024-08-01 00:00:00.000","1",false,"{""type"": ""person"", ""name"": ""John Doe"", ""phone"": ""1234567890"", ""alternative_phone"": ""0987654321"", ""is_active"": ""true"", ""notes"": ""Test note"", ""contact_id"": ""C123"", ""muted"": ""false"", ""parent"": {""_id"": ""parent1""}, ""reported_date"": 1627804800000}" | ||
"2024-08-01 00:00:00.000","2",false,"{""type"": ""person"", ""name"": ""Jane Doe"", ""phone"": ""1234567890"", ""alternative_phone"": ""0987654321"", ""is_active"": ""false"", ""notes"": ""Another note"", ""contact_id"": ""C124"", ""muted"": """", ""parent"": {""_id"": ""parent2""}, ""reported_date"": 1627804800000}" | ||
"2024-08-02 00:00:00.000","3",false,"{""type"": ""clinic"", ""name"": ""Test Clinic"", ""phone"": ""1122334455"", ""alternative_phone"": ""5544332211"", ""is_active"": ""true"", ""notes"": ""Clinic note"", ""contact_id"": ""C125"", ""muted"": ""true"", ""parent"": {""_id"": ""parent3""}, ""reported_date"": 1627804800000}" | ||
"2024-08-02 00:00:00.000","4",true,"{""type"": ""person"", ""name"": ""Deleted Contact"", ""phone"": ""0000000000"", ""alternative_phone"": ""1111111111"", ""is_active"": ""false"", ""notes"": ""This record should be deleted"", ""contact_id"": ""C126"", ""muted"": ""false"", ""parent"": {""_id"": ""parent4""}, ""reported_date"": 1627804800000}" |