-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ca1847
commit 60f42ca
Showing
7 changed files
with
115 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import pytest | ||
from snowflake.cli.api.utils.rendering import snowflake_cli_jinja_render | ||
|
||
|
||
def test_rendering_with_data(): | ||
assert snowflake_cli_jinja_render("%{ foo }", data={"foo": "bar"}) == "bar" | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"text, output", | ||
[ | ||
# Green path | ||
("%{ foo }", "bar"), | ||
# Using $ as sf variable and basic jinja for server side | ||
("${{ foo }}", "${{ foo }}"), | ||
("$%{ foo }{{ var }}", "$bar{{ var }}"), | ||
("${{ %{ foo } }}", "${{ bar }}"), | ||
# Using $ as sf variable and client side rendering | ||
("$%{ foo }", "$bar"), | ||
], | ||
) | ||
def test_rendering(text, output): | ||
assert snowflake_cli_jinja_render(text, data={"foo": "bar"}) == output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters