-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73aebd8
commit 84c142f
Showing
12 changed files
with
207 additions
and
248 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
200 changes: 0 additions & 200 deletions
200
test/integration/023_exit_codes_tests/test_exit_codes.py
This file was deleted.
Oops, something went wrong.
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,78 @@ | ||
import pytest | ||
|
||
bad_sql = """ | ||
select bad sql here | ||
""" | ||
|
||
dupe_sql = """ | ||
select 1 as id, current_date as updated_at | ||
union all | ||
select 2 as id, current_date as updated_at | ||
union all | ||
select 3 as id, current_date as updated_at | ||
union all | ||
select 4 as id, current_date as updated_at | ||
""" | ||
|
||
good_sql = """ | ||
select 1 as id, current_date as updated_at | ||
union all | ||
select 2 as id, current_date as updated_at | ||
union all | ||
select 3 as id, current_date as updated_at | ||
union all | ||
select 4 as id, current_date as updated_at | ||
""" | ||
|
||
snapshots_good_sql = """ | ||
{% snapshot good_snapshot %} | ||
{{ config(target_schema=schema, target_database=database, strategy='timestamp', unique_key='id', updated_at='updated_at')}} | ||
select * from {{ schema }}.good | ||
{% endsnapshot %} | ||
""" | ||
|
||
snapshots_bad_sql = """ | ||
{% snapshot good_snapshot %} | ||
{{ config(target_schema=schema, target_database=database, strategy='timestamp', unique_key='id', updated_at='updated_at_not_real')}} | ||
select * from {{ schema }}.good | ||
{% endsnapshot %} | ||
""" | ||
|
||
schema_yml = """ | ||
version: 2 | ||
models: | ||
- name: good | ||
columns: | ||
- name: updated_at | ||
tests: | ||
- not_null | ||
- name: bad | ||
columns: | ||
- name: updated_at | ||
tests: | ||
- not_null | ||
- name: dupe | ||
columns: | ||
- name: updated_at | ||
tests: | ||
- unique | ||
""" | ||
|
||
data_seed_good_csv = """a,b,c | ||
1,2,3 | ||
""" | ||
|
||
data_seed_bad_csv = """a,b,c | ||
1,\2,3,a,a,a | ||
""" | ||
|
||
|
||
class BaseConfigProject: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return { | ||
"bad.sql": bad_sql, | ||
"dupe.sql": dupe_sql, | ||
"good.sql": good_sql, | ||
"schema.yml": schema_yml | ||
} |
Oops, something went wrong.