-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MAINTENANCE] Refactor EmailAction
for V1
#9725
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f2fe218
start impl
cdkini 7f886f7
renderer unit test
cdkini 148deb3
add action test
cdkini e22abd2
mypy
cdkini b61c207
misc updates to tests
cdkini 0080e12
Merge branch 'develop' of https://github.com/great-expectations/great…
cdkini File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,8 @@ | |
) | ||
from great_expectations.render.renderer import EmailRenderer | ||
|
||
# module level markers | ||
pytestmark = pytest.mark.big | ||
|
||
|
||
@pytest.mark.big | ||
def test_EmailRenderer_validation_results_with_datadocs(): | ||
validation_result_suite = ExpectationSuiteValidationResult( | ||
results=[], | ||
|
@@ -64,6 +62,7 @@ def test_EmailRenderer_validation_results_with_datadocs(): | |
assert rendered_output == expected_output | ||
|
||
|
||
@pytest.mark.big | ||
def test_EmailRenderer_checkpoint_validation_results_with_datadocs(): | ||
batch_definition = LegacyBatchDefinition( | ||
datasource_name="test_datasource", | ||
|
@@ -120,6 +119,7 @@ def test_EmailRenderer_checkpoint_validation_results_with_datadocs(): | |
assert rendered_output == expected_output | ||
|
||
|
||
@pytest.mark.big | ||
def test_EmailRenderer_get_report_element(): | ||
email_renderer = EmailRenderer() | ||
|
||
|
@@ -130,3 +130,26 @@ def test_EmailRenderer_get_report_element(): | |
|
||
# this should work | ||
assert email_renderer._get_report_element(docs_link="i_should_work") is not None | ||
|
||
|
||
@pytest.mark.unit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
def test_EmailRenderer_v1_render(v1_checkpoint_result): | ||
email_renderer = EmailRenderer() | ||
_, raw_html = email_renderer.v1_render(checkpoint_result=v1_checkpoint_result) | ||
html_blocks = raw_html.split("\n") | ||
|
||
assert html_blocks == [ | ||
"<p><strong><h3><u>my_bad_suite</u></h3></strong></p>", | ||
"<p><strong>Batch Validation Status</strong>: Failed ❌</p>", | ||
"<p><strong>Expectation Suite Name</strong>: my_bad_suite</p>", | ||
"<p><strong>Data Asset Name</strong>: my_first_asset</p>", | ||
"<p><strong>Run ID</strong>: __no_run_id__</p>", | ||
"<p><strong>Batch ID</strong>: my_batch</p>", | ||
"<p><strong>Summary</strong>: <strong>3</strong> of <strong>5</strong> expectations were met</p><br><p><strong><h3><u>my_good_suite</u></h3></strong></p>", # noqa: E501 | ||
"<p><strong>Batch Validation Status</strong>: Success 🎉</p>", | ||
"<p><strong>Expectation Suite Name</strong>: my_good_suite</p>", | ||
"<p><strong>Data Asset Name</strong>: __no_asset_name__</p>", | ||
"<p><strong>Run ID</strong>: my_run_id</p>", | ||
"<p><strong>Batch ID</strong>: my_other_batch</p>", | ||
"<p><strong>Summary</strong>: <strong>1</strong> of <strong>1</strong> expectations were met</p>", # noqa: E501 | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ANY makes sense here, but I might add another assertion below to verify that the argument passed kind of looks like the right string. (e.g.
suite_name in call_args.kwargs["title"]
(or whatever the syntax is for that))