Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Beck committed Mar 6, 2020
1 parent 757bdf6 commit 16692e2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- should be ref('model')
select * from {{ ref(model) }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select 1 as id
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import os

from dbt.exceptions import CompilationException

from test.integration.base import DBTIntegrationTest, use_profile


class TestSimpleReference(DBTIntegrationTest):
@property
def schema(self):
Expand Down Expand Up @@ -184,3 +189,20 @@ def test__snowflake__simple_reference_with_models_and_children(self):

self.assertTrue('EPHEMERAL_SUMMARY' in created_models)
self.assertEqual(created_models['EPHEMERAL_SUMMARY'], 'table')


class TestErrorReference(DBTIntegrationTest):
@property
def schema(self):
return "simple_reference_003"

@property
def models(self):
return "invalid-models"

@use_profile('postgres')
def test_postgres_undefined_value(self):
with self.assertRaises(CompilationException) as exc:
self.run_dbt(['compile'])
path = os.path.join('invalid-models', 'descendant.sql')
self.assertIn(path, str(exc.exception))

0 comments on commit 16692e2

Please sign in to comment.