def test_var_defined_is_missing(self): var = Var(self.model, self.context, overrides={}) var.assert_var_defined('foo', 'bar') with self.assertRaises(dbt.exceptions.CompilationException): var.assert_var_defined('foo', None)
def test_var_not_none_is_none(self): var = Var(self.model, self.context, overrides={'foo': None}) var.assert_var_defined('foo', None) with self.assertRaises(dbt.exceptions.CompilationException): var.assert_var_not_none('foo')
def __init__(self, cli_vars): self.context = {'env_var': env_var} self.context['var'] = Var(None, self.context, cli_vars)