-
Notifications
You must be signed in to change notification settings - Fork 11
Enforce RFC 7540 rules about stream weights #52
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
Conversation
981ab6e to
1724885
Compare
Lukasa
left a comment
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.
This looks really good! One small note about the testing.
test/test_priority.py
Outdated
| """ | ||
| with pytest.raises(priority.BadWeightError) as err: | ||
| priority.Stream(stream_id=0, weight=bad_weight) | ||
| assert err.value.args[0] == 'Stream weight should be an integer' |
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.
Rather than test these by constructing the stream object directly, it might be better to use the public API methods for this test. That way, if we ever move this validation the tests will continue to reflect the actual intent.
1724885 to
40e5d3d
Compare
|
Test updated; |
|
Changeling entry? How very Strossian of you. |
| assert ( | ||
| err.value.args[0] == | ||
| 'Stream weight must be between 1 and 256 (inclusive)') | ||
|
|
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.
We should probably add variations of these tests that also call reprioritize.
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.
Added.
|
Cool, this looks good. We'll see if the tests pass, of course. ;) |
Fixes #50.