Allow omitted rule constraints to match any value#101
Merged
Conversation
OrangeTux
approved these changes
Jul 25, 2020
OrangeTux
left a comment
Collaborator
There was a problem hiding this comment.
Again, many thanks for your work!
OrangeTux
reviewed
Jul 25, 2020
| @@ -1,5 +1,6 @@ | |||
| -r requirements.txt | |||
|
|
|||
| mock==3.0.5;python_version<"3.3" | |||
Collaborator
There was a problem hiding this comment.
I was a bit to quick with approving the PR. I'm wondering why you added mock as development dependency. I don't see it being used in your PR.
Contributor
Author
There was a problem hiding this comment.
You cannot run tests on Python < 3.3 without it, which blocked my adding unit tests that go with this change.
uModbus/tests/unit/test_functions.py
Lines 4 to 8 in dcf35a1
In the future when you target only newer versions of Python (#86), you ought to remove the requirement and the check from the above code.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The definition of
umodbus.server.routegives default values ofNoneto the arguments, suggesting they can be omitted. However, if you actually provideNone, it will fail later when evaluatingDataRule.match.This change makes it possible to omit any rule constraint to match on any value.