File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change
1
+ import os
2
+
1
3
import pytest
2
4
from dbt .tests .util import run_dbt
3
5
@@ -17,6 +19,19 @@ def models(self):
17
19
def profile_extra_options ():
18
20
return {"schema_authorization" : "{{ env_var('DBT_TEST_USER_1') }}" }
19
21
20
- def test_schema_creation (self , project ):
21
- res = run_dbt (["run" , "-s" , "dummy" ])
22
+ @staticmethod
23
+ def _verify_schema_owner (schema_name , owner , project ):
24
+ get_schema_owner = f"""
25
+ select schema_owner from information_schema.schemata where schema_name = '{ schema_name } '
26
+ """
27
+ result = project .run_sql (get_schema_owner , fetch = "one" )[0 ]
28
+ assert result == owner
29
+
30
+ def test_schema_creation (self , project , unique_schema ):
31
+ res = run_dbt (["run" ])
22
32
assert len (res ) == 1
33
+
34
+ self ._verify_schema_owner (unique_schema , os .getenv ("DBT_TEST_USER_1" ), project )
35
+ self ._verify_schema_owner (
36
+ unique_schema + "_with_custom_auth" , os .getenv ("DBT_TEST_USER_1" ), project
37
+ )
You can’t perform that action at this time.
0 commit comments