-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/improved-ci'
# Conflicts: # .github/workflows/python-test.yml
- Loading branch information
Showing
5 changed files
with
156 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<!-- | ||
Before you open this PR: | ||
1. Have you tested? | ||
2. Have you read the contributing guidelines? | ||
3. Do you have a helpful description of your changes? | ||
4. **Should it be a draft for now?** | ||
5. Have you got a demonstration of changes, if applicable? | ||
It is encouraged to use GPG or SSH signing for your commits. | ||
If your PR has many commits, it will likely be squash-merged. | ||
--> | ||
# Description | ||
|
||
<!-- Write a brief description about what this PR aims to achieve here --> | ||
|
||
## Type of change | ||
|
||
<!-- This is simply for triage purposes. You can select multiple. --> | ||
<!-- Feel free to check only the boxes you need and remove the other ones, or keep them. --> | ||
|
||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] Non-breaking new feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to change) | ||
- [ ] Documentation update | ||
|
||
<!-- Guide to "what is my PR???" | ||
- A bug fix is just that - a fix to an existing bug. Does not introduce any new functionality beyond | ||
fixing the bug. | ||
- Non breaking new feature - a new feature that is entirely backwards compatible with the previous | ||
release | ||
- Breaking change - a new feature, or change to an existing one that is core to the library/heavily | ||
used, and is not backwards compatible with the previous release | ||
Such changes could be changes to logging in, or sending messages, or parsing events. | ||
Generally, signature changes of the client are regarded as "breaking", unless they're | ||
underscored functions. | ||
- Documentation update - changes to the documentation, README, or other documentation files. | ||
--> | ||
|
||
## Checklist | ||
|
||
<!-- This is just to make sure you've actually read stuff --> | ||
|
||
- [ ] I acknowledge that incorrectly filling in this template will result in my PR being closed. | ||
- [ ] I have read and understood the [contributing guidelines](https://github.com/nexy7574/nio-bot/blob/master/CONTRIBUTING.md). | ||
- [ ] I have ensured that my code follows this project's formatting. | ||
<!-- tip: `ruff format && ruff check --fix`. CI will scream at you if you don't. --> | ||
- [ ] I have unit tested my code. | ||
- [ ] I have added additional tests to the suite to cover my changes, where necessary. | ||
<!-- if you're not making any changes that change behaviour, like docs changes, check this anyway --> | ||
- [ ] I have tested my changes locally in a live environment. | ||
<!-- ^ This one is optional but highly appreciated and encouraged. --> | ||
|
||
|
||
## Additional context/demonstration | ||
|
||
<!-- If you've got anything to show off, put it here! --> |
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 niobot.utils.string_view import ArgumentView | ||
|
||
STRINGS = [ | ||
["hello world", ["hello", "world"]], | ||
["hello 'world'", ["hello", "world"]], | ||
["'hello world'", ["hello world"]], | ||
["hello 'world' 'two'", ["hello", "world", "two"]], | ||
["hello 'world two'", ["hello", "world two"]], | ||
["hello 'world two' three", ["hello", "world two", "three"]], | ||
["\"hello 'world'\"", ["hello 'world'"]], | ||
["""Hello "'`world`'"!""", ["Hello", "'`world`'", "!"]], | ||
['''"""hello world"""''', ["hello world"]], | ||
["""'''hello world''""", ["hello world"]], | ||
] | ||
|
||
|
||
@pytest.mark.parametrize("string, expected", STRINGS) | ||
def test_string_view(string, expected): | ||
sv = ArgumentView(string) | ||
sv.parse_arguments() | ||
assert sv.arguments == expected |