|
1 | 1 | # -*- coding: utf-8 -*- |
2 | | -from hpack.hpack import Encoder, Decoder, _dict_to_iterable, _to_bytes |
3 | | -from hpack.exceptions import ( |
4 | | - HPACKDecodingError, InvalidTableIndex, OversizedHeaderListError, |
5 | | - InvalidTableSizeError |
6 | | -) |
7 | | -from hpack.struct import HeaderTuple, NeverIndexedHeaderTuple |
8 | 2 | import itertools |
9 | 3 | import pytest |
10 | 4 |
|
11 | 5 | from hypothesis import given |
12 | 6 | from hypothesis.strategies import text, binary, sets, one_of |
13 | 7 |
|
| 8 | +from hpack import ( |
| 9 | + Encoder, |
| 10 | + Decoder, |
| 11 | + HeaderTuple, |
| 12 | + NeverIndexedHeaderTuple, |
| 13 | + HPACKDecodingError, |
| 14 | + InvalidTableIndex, |
| 15 | + OversizedHeaderListError, |
| 16 | + InvalidTableSizeError, |
| 17 | +) |
| 18 | +from hpack.hpack import _dict_to_iterable, _to_bytes |
| 19 | + |
14 | 20 | try: |
15 | 21 | unicode = unicode |
16 | 22 | except NameError: |
17 | 23 | unicode = str |
18 | 24 |
|
19 | 25 |
|
20 | | -class TestHPACKEncoder(object): |
| 26 | +class TestHPACKEncoder: |
21 | 27 | # These tests are stolen entirely from the IETF specification examples. |
22 | 28 | def test_literal_header_field_with_indexing(self): |
23 | 29 | """ |
@@ -338,7 +344,7 @@ def test_evicting_header_table_objects(self): |
338 | 344 | assert len(e.header_table.dynamic_entries) == 1 |
339 | 345 |
|
340 | 346 |
|
341 | | -class TestHPACKDecoder(object): |
| 347 | +class TestHPACKDecoder: |
342 | 348 | # These tests are stolen entirely from the IETF specification examples. |
343 | 349 | def test_literal_header_field_with_indexing(self): |
344 | 350 | """ |
@@ -737,7 +743,7 @@ def test_truncated_header_value(self): |
737 | 743 | d.decode(data) |
738 | 744 |
|
739 | 745 |
|
740 | | -class TestDictToIterable(object): |
| 746 | +class TestDictToIterable: |
741 | 747 | """ |
742 | 748 | The dict_to_iterable function has some subtle requirements: validates that |
743 | 749 | everything behaves as expected. |
|
0 commit comments