Skip to content

Commit

Permalink
Reorganize test files
Browse files Browse the repository at this point in the history
  • Loading branch information
genzgd committed Nov 23, 2023
1 parent d4b7b88 commit f3c22b2
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 29 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions tests/integration/adapter/dbt_debug/test_dbt_debug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import re

from dbt.tests.adapter.dbt_debug.test_dbt_debug import BaseDebug
from dbt.tests.util import run_dbt


class TestDebugClickHouse(BaseDebug):
def test_ok(self, project):
run_dbt(["debug"])
assert "ERROR" not in self.capsys.readouterr().out

def test_nopass(self, project):
run_dbt(["debug", "--target", "nopass"], expect_pass=False)
self.assertGotValue(re.compile(r"\s+profiles\.yml file"), "ERROR invalid")

def test_wronguser(self, project):
run_dbt(["debug", "--target", "wronguser"], expect_pass=False)
self.assertGotValue(re.compile(r"\s+Connection test"), "ERROR")

def test_empty_target(self, project):
run_dbt(["debug", "--target", "none_target"], expect_pass=False)
self.assertGotValue(re.compile(r"\s+output 'none_target'"), "misconfigured")
9 changes: 9 additions & 0 deletions tests/integration/adapter/dbt_show/test_dbt_show.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from dbt.tests.adapter.dbt_show.test_dbt_show import BaseShowLimit, BaseShowSqlHeader


class TestShowLimit(BaseShowLimit):
pass


class TestShowSqlHeader(BaseShowSqlHeader):
pass
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import os

import pytest
from dbt.tests.adapter.grants.test_incremental_grants import BaseIncrementalGrants
from dbt.tests.adapter.grants.test_invalid_grants import BaseInvalidGrants
from dbt.tests.adapter.grants.test_model_grants import BaseModelGrants
from dbt.tests.adapter.grants.test_seed_grants import BaseSeedGrants
from dbt.tests.adapter.grants.test_snapshot_grants import BaseSnapshotGrants
from dbt.tests.util import get_manifest, run_dbt_and_capture, write_file

distributed_table_model_schema_yml = """
Expand All @@ -20,31 +16,6 @@
"""


class TestModelGrants(BaseModelGrants):
pass


class TestIncrementalGrants(BaseIncrementalGrants):
pass


class TestSeedGrants(BaseSeedGrants):
pass


class TestInvalidGrants(BaseInvalidGrants):
def grantee_does_not_exist_error(self):
return "511"

# ClickHouse doesn't give a very specific error for an invalid privilege
def privilege_does_not_exist_error(self):
return "Syntax error"


class TestSnapshotGrants(BaseSnapshotGrants):
pass


class TestDistributedTableModelGrants(BaseModelGrants):
@pytest.mark.skipif(
os.environ.get('DBT_CH_TEST_CLUSTER', '').strip() == '', reason='Not on a cluster'
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/adapter/grants/test_incremental_grants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.grants.test_incremental_grants import BaseIncrementalGrants


class TestIncrementalGrants(BaseIncrementalGrants):
pass
10 changes: 10 additions & 0 deletions tests/integration/adapter/grants/test_invalid_grants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from dbt.tests.adapter.grants.test_invalid_grants import BaseInvalidGrants


class TestInvalidGrants(BaseInvalidGrants):
def grantee_does_not_exist_error(self):
return "511"

# ClickHouse doesn't give a very specific error for an invalid privilege
def privilege_does_not_exist_error(self):
return "Syntax error"
5 changes: 5 additions & 0 deletions tests/integration/adapter/grants/test_model_grants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.grants.test_model_grants import BaseModelGrants


class TestModelGrants(BaseModelGrants):
pass
5 changes: 5 additions & 0 deletions tests/integration/adapter/grants/test_seed_grants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.grants.test_seed_grants import BaseSeedGrants


class TestSeedGrants(BaseSeedGrants):
pass
5 changes: 5 additions & 0 deletions tests/integration/adapter/grants/test_snapshot_grants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.grants.test_snapshot_grants import BaseSnapshotGrants


class TestSnapshotGrants(BaseSnapshotGrants):
pass

0 comments on commit f3c22b2

Please sign in to comment.