Open twam opened 2 years ago
Your PR is failing the test_descriptor_collection
unit test:
got: [9, 2, 32, 0, 1, 1, 0, 128, 250, 9, 4, 1, 0, 2, 255, 255, 255, 0, 9, 5, 129, 2, 64, 0, 255, 9, 5, 1, 2, 64, 0, 255]
expected: [9, 2, 32, 0, 1, 1, 0, 128, 250, 9, 4, 1, 0, 2, 255, 255, 255, 0, 7, 5, 129, 2, 64, 0, 255, 7, 5, 1, 2, 64, 0, 255]
Your approach works when creating the descriptor using EndpointDescriptor.build()
but using the context manager syntax with i.EndpointDescriptor() as e:
the descriptor's bLength
field will be set to 9
even when the optional fields aren't specified.
Fix creation of EndpointDescriptor and add unit tests for both possible lengths.