-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test exception on composite metadata tag longer than 256
- Loading branch information
gabi
committed
Feb 12, 2022
1 parent
8d91ee2
commit b636d1b
Showing
3 changed files
with
17 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
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,14 @@ | ||
import pytest | ||
|
||
from rsocket.exceptions import RSocketError | ||
from rsocket.extensions.composite_metadata import CompositeMetadata | ||
from rsocket.extensions.routing import RoutingMetadata | ||
|
||
|
||
def test_tag_composite_metadata_too_long(): | ||
routing = RoutingMetadata(tags=[('some data too long %s' % ''.join(['x'] * 256)).encode()]) | ||
composite_metadata = CompositeMetadata() | ||
composite_metadata.items.append(routing) | ||
|
||
with pytest.raises(RSocketError): | ||
composite_metadata.serialize() |
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