This is a dbt package to enhance dbt package development by providing unit testing macros.
Check dbt Hub for the latest installation instructions.
- dbt-core: 1.0.0 or later
Test that expr is true.
Usage:
{{ dbt_unittest.assert_true(true) }}
{{ dbt_unittest.assert_true(1 == 1) }}
Test that expr is false.
Usage:
{{ dbt_unittest.assert_false(false) }}
{{ dbt_unittest.assert_false(1 != 1) }}
Test that expr is None.
Usage:
{{ dbt_unittest.assert_is_none(none) }}
Test that expr is not None.
Usage:
{{ dbt_unittest.assert_is_not_none(none) }}
Test that first and second are equal. If the values do not compare equal, the test will fail.
Usage:
{{ dbt_unittest.assert_equals("foo", "bar") }}
Test that first and second are not equal. If the values do compare equal, the test will fail.
Usage:
{{ dbt_unittest.assert_not_equals("foo", "bar") }}
Test that member is in container.
Usage:
{{ dbt_unittest.assert_in(1, [1, 2, 3]) }}
Test that member is not in container.
Usage:
{{ dbt_unittest.assert_not_in(1, [1, 2, 3]) }}
Tests that two lists are equal.
Usage:
{{ dbt_unittest.assert_list_equals([1, 2, 3], [4, 5]) }}
Test that two dictionaries are equal.
Usage:
{{ dbt_unittest.assert_dict_equals({"k": 1}, {"k": 1}) }}