-
Notifications
You must be signed in to change notification settings - Fork 0
Fix #16 and #21 #22
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
Merged
Fix #16 and #21 #22
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
57f32bb
Initial plan
Copilot 79e03fc
Replace pkg_resources with importlib.metadata
Copilot 8222fd5
Add importlib-metadata backport for Python 3.6-3.7 compatibility
Copilot 0eed3ec
Merge pull request #18 from cvraut/copilot/remove-pkg-resources-depen…
cvraut e20cd1e
updated testing suite to remove windows 2019 and included py36 and py…
cvraut 5624ee5
removed tox lines at the end of the yml file
cvraut 59ca57e
mapped python version to supported runners in gha
cvraut 5c4c60b
switched depreciated windows-2019 to windows-2022 for python 3.6 testing
cvraut df521e8
actually added the correct file for the commit
cvraut 9ea668e
added isolated build option to tox.ini file to hopefully get automate…
cvraut c5cf3ba
fixed the version dependent import for python 3.6 compatibility
cvraut e4379c3
actually fixed the metadata import
cvraut f10a39d
added utf-8 restriction to tox.ini
cvraut 811e974
added option to force skip missing runners in tox
cvraut 210d6d1
simplified tox.ini to not use explicit python defs, also commented ou…
cvraut f12bb10
added back full test suite
cvraut 5dfd55b
try to switch to latest ubuntu to test python 3.6
cvraut db5ec7b
try to switch to ubuntu-20.04 for python 3.6 test
cvraut 2657016
decide to consolidate python 3.6 testing to only windows runners on g…
cvraut af10f2b
added new discord webhook format url to test cases
cvraut 71bba88
should fix #21
cvraut 291af6c
added the new URL secret to the workflows.yml file so that the runner…
cvraut b589582
added some debug code to see what fuckery is happening with github ac…
cvraut 221d4f9
gha debugging
cvraut 52ba25b
added -s flag to tox.ini to make sure pytest prints all stdout and st…
cvraut 014ae52
added the discord url to the tox.ini file as well to make sure it is …
cvraut 43e3d02
removed the -s flag from the tox.ini file
cvraut a210ec1
removed the PR testing run. Seems redundant and the PR actions run us…
cvraut e97eb0d
Update pyproject.toml
cvraut 271de31
Update whecho/README.md
cvraut 9339ab9
added null checks for message and url. Also added unit tests for null…
cvraut d4dafd8
removed non-sensical tests from whecho_simple
cvraut 7c3e787
added conditional for emoji in help function, causes issues in non ut…
cvraut 737d6c3
created seperate test file to test nulls for post_message
cvraut 4be62e3
removed unsed platform import
cvraut 9dc3f03
Apply suggestions from code review
cvraut e0e623a
removed redundant test in post message
cvraut 1387d49
switched terminal encoding logic to handle None values from sys.stdout
cvraut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,28 @@ | ||
| import os | ||
|
|
||
| from whecho._send_message import post_simple | ||
|
|
||
| def test_no_url_in_config(): | ||
| # test that an error is raised when no URL is passed and no URL in config | ||
| try: | ||
| post_simple("This should fail", None, conf={'default_url': None}) | ||
| except ValueError as e: | ||
| assert str(e) == 'No URL passed. Did you run whecho --init?' | ||
| else: | ||
| assert False, "Expected Error message was not delivered" | ||
|
cvraut marked this conversation as resolved.
|
||
|
|
||
| def test_no_message(): | ||
| # test that an error is raised when no message is passed | ||
| url = os.environ.get("TEST_URL", None) | ||
| if not url: | ||
| raise ValueError(f'No test URL passed. Did you set the TEST_URL environment variable?') | ||
| try: | ||
| post_simple("", url) | ||
| except ValueError as e: | ||
| assert str(e) == 'No message passed. Try whecho --help for more info.' | ||
| else: | ||
| assert False, "Expected Error message was not delivered" | ||
|
|
||
| if __name__ == "__main__": | ||
| test_no_url_in_config() | ||
| test_no_message() | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.