Skip to content

Conversation

@alexwlchan
Copy link
Contributor

Fixes #50.

Copy link
Member

@Lukasa Lukasa left a 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.

"""
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'
Copy link
Member

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.

@alexwlchan
Copy link
Contributor Author

alexwlchan commented Jan 22, 2017

Test updated; changeling changelog entry added.

@Lukasa
Copy link
Member

Lukasa commented Jan 22, 2017

Changeling entry? How very Strossian of you.

assert (
err.value.args[0] ==
'Stream weight must be between 1 and 256 (inclusive)')

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@Lukasa
Copy link
Member

Lukasa commented Jan 22, 2017

Cool, this looks good. We'll see if the tests pass, of course. ;)

@Lukasa Lukasa merged commit 1629d7c into master Jan 22, 2017
@Lukasa Lukasa deleted the awlc/weights branch January 22, 2017 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants