Skip to content

Commit

Permalink
Adding
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachin-Thakur committed Nov 3, 2023
1 parent 019f146 commit b6cd0fb
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions tests/functional/adapter/dbt_clone/test_dbt_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
from collections import Counter
from dbt.tests.util import run_dbt
from dbt.tests.adapter.dbt_clone.test_dbt_clone import BaseClonePossible

import pytest
import shutil
import os


class TestSnowflakeClonePossible(BaseClonePossible):

def test_can_clone_true(self, project, unique_schema, other_schema):
project.create_test_schema(other_schema)
print(other_schema)
self.run_and_save_state(project.project_root, with_snapshot=True)

clone_args = [
"clone",
"--state",
Expand All @@ -24,7 +21,6 @@ def test_can_clone_true(self, project, unique_schema, other_schema):

results = run_dbt(clone_args)
assert len(results) == 4
print(results)

schema_relations = project.adapter.list_relations(
database=project.database, schema=other_schema
Expand All @@ -46,21 +42,21 @@ def test_can_clone_true(self, project, unique_schema, other_schema):
assert len(results) == 2
assert all("no-op" in r.message.lower() for r in results)

# @pytest.fixture(autouse=True)
# def clean_up(self, project):
# yield
# with project.adapter.connection_named("__test"):
# relation = project.adapter.Relation.create(
# database=project.database, schema=f"{project.test_schema}_SEEDS"
# )
# project.adapter.drop_schema(relation)
@pytest.fixture(autouse=True)
def clean_up(self, project):
yield
with project.adapter.connection_named("__test"):
relation = project.adapter.Relation.create(
database=project.database, schema=f"{project.test_schema}_SEEDS"
)
project.adapter.drop_schema(relation)

# relation = project.adapter.Relation.create(
# database=project.database, schema=project.test_schema
# )
# project.adapter.drop_schema(relation)
relation = project.adapter.Relation.create(
database=project.database, schema=project.test_schema
)
project.adapter.drop_schema(relation)

# pass
pass


table_model_1_sql = """
Expand All @@ -71,9 +67,6 @@ def test_can_clone_true(self, project, unique_schema, other_schema):
select 1 as fun
"""





class TestSnowflakeCloneTrainsentTable:
@pytest.fixture(scope="class")
Expand Down

0 comments on commit b6cd0fb

Please sign in to comment.