Skip to content

Commit

Permalink
Add test cases for mermaid
Browse files Browse the repository at this point in the history
  • Loading branch information
syou6162 committed Feb 8, 2024
1 parent 3c64a87 commit 349b1cc
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class TestMermaidTestRelationship:
[],
[],
["model"],
False,
"""erDiagram
"MODEL.DBT_RESTO.TABLE1" {
name1-type name1
Expand Down Expand Up @@ -73,6 +74,7 @@ class TestMermaidTestRelationship:
[],
[],
["model", "source"],
False,
"""erDiagram
"MODEL.DBT_RESTO.TABLE1" {
name1-type name1
Expand Down Expand Up @@ -118,6 +120,7 @@ class TestMermaidTestRelationship:
["schema:--schema--"],
[],
["model", "source"],
False,
"""erDiagram
"MODEL.DBT_RESTO.TABLE1" {
name1-type name1
Expand All @@ -139,6 +142,7 @@ class TestMermaidTestRelationship:
[],
["model.dbt_resto.table1"],
["model"],
False,
"""erDiagram
""",
),
Expand All @@ -165,6 +169,7 @@ class TestMermaidTestRelationship:
["model.dbt_resto"],
["model.dbt_resto.table2"],
["model"],
False,
"""erDiagram
"MODEL.DBT_RESTO.TABLE1" {
name1-type name1
Expand All @@ -186,6 +191,7 @@ class TestMermaidTestRelationship:
["schema:", "wildcard:", ""],
[],
["model"],
False,
"""erDiagram
"MODEL.DBT_RESTO.TABLE1" {
name1-type name1
Expand Down Expand Up @@ -215,12 +221,34 @@ class TestMermaidTestRelationship:
["schema:--schema--,wildcard:*dbt_resto.table*"],
["wildcard:*table2"],
["model"],
False,
"""erDiagram
"MODEL.DBT_RESTO.TABLE1" {
name1-type name1
}
""",
),
(
[
Table(
name="model.dbt_resto.table1",
node_name="model.dbt_resto.table1",
database="--database--",
schema="--schema--",
columns=[Column(name="name1", data_type="name1-type")],
raw_sql="--irrelevant--",
)
],
[],
[],
[],
["model"],
True,
"""erDiagram
"MODEL.DBT_RESTO.TABLE1" {
}
""",
),
],
)
def test_parse(
Expand All @@ -239,6 +267,7 @@ def test_parse(
catalog="--catalog--",
select=select,
exclude=exclude,
omit_columns=omit_columns,
resource_type=resource_type,
)
print("mermaid ", mermaid.replace(" ", "").replace("\n", ""))
Expand Down

0 comments on commit 349b1cc

Please sign in to comment.