-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add generic test and unit test for users model
- Loading branch information
Maria Lorena Rodriguez Viruel
committed
Aug 27, 2024
1 parent
1fea79b
commit a4c0608
Showing
9 changed files
with
50 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
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: source('couchdb', "{{ env_var('POSTGRES_TABLE') }}") | ||
format: csv | ||
fixture: contacts_initial_data | ||
fixture: document_metadata_initial | ||
expect: | ||
format: csv | ||
fixture: contacts_document_metadata_initial_expected | ||
fixture: document_metadata_initial_expected | ||
|
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,19 @@ | ||
unit_tests: | ||
- name: test_user_model_transformation_and_data_integrity | ||
description: | | ||
This unit test validates the transformation logic in the `user` model and ensures data integrity. | ||
It uses fixture data for both `document_metadata` and `source_table` to test the complete logic. | ||
model: user | ||
overrides: | ||
macros: | ||
is_incremental: false | ||
given: | ||
- input: ref('document_metadata') | ||
format: csv | ||
fixture: user_document_metadata_initial | ||
- input: source('couchdb', "{{ env_var('POSTGRES_TABLE') }}") | ||
format: csv | ||
fixture: user_source_table_initial | ||
expect: | ||
format: csv | ||
fixture: user_initial_expected |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
uuid,_deleted,saved_timestamp,doc_type | ||
1,false,2024-08-01 00:00:00,user-settings | ||
2,false,2024-08-01 00:00:00,user-settings | ||
3,false,2024-08-02 00:00:00,user-settings | ||
4,false,2024-08-02 00:00:00,user-settings | ||
5,true,2024-08-02 00:00:00,other-type | ||
|
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 @@ | ||
user_id,saved_timestamp,contact_uuid,language,roles | ||
1,2024-08-01 00:00:00,1001,en,admin | ||
2,2024-08-01 00:00:00,1002,fr,user | ||
3,2024-08-02 00:00:00,1003,es,guest | ||
4,2024-08-02 00:00:00,1004,de,user | ||
|
||
|
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 @@ | ||
saved_timestamp,_id,_deleted,doc | ||
2024-08-01 00:00:00,1,false,"{""type"": ""user-settings"", ""contact_id"": ""1001"", ""language"": ""en"", ""roles"": ""admin""}" | ||
2024-08-01 00:00:00,2,false,"{""type"": ""user-settings"", ""facility_id"": ""1002"", ""language"": ""fr"", ""roles"": ""user""}" | ||
2024-08-02 00:00:00,3,false,"{""type"": ""user-settings"", ""contact_id"": ""1003"", ""language"": ""es"", ""roles"": ""guest""}" | ||
2024-08-02 00:00:00,4,false,"{""type"": ""user-settings"", ""contact_id"": ""1004"", ""language"": ""de"", ""roles"": ""user""}" | ||
2024-08-02 00:00:00,5,true,"{""type"": ""other-type"", ""contact_id"": ""1005"", ""language"": ""it"", ""roles"": ""admin""}" | ||
|
This file was deleted.
Oops, something went wrong.