-
Notifications
You must be signed in to change notification settings - Fork 230
Add max_size option to ConsoleExpectMixin read #912
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
Add max_size option to ConsoleExpectMixin read #912
Conversation
Codecov Report
@@ Coverage Diff @@
## master #912 +/- ##
======================================
Coverage 56.8% 56.8%
======================================
Files 149 149
Lines 11091 11096 +5
======================================
+ Hits 6301 6306 +5
Misses 4790 4790
Continue to review full report at Codecov.
|
b0dfbc9 to
96c8fd6
Compare
|
IMO the RFC from the commit message can be removed. |
Implement 'max_size' parameter to limit the maximal number of bytes read and returned by the 'read'-function of the serial driver and the externalconsole driver. 'max_size' defaults to 'None'. Values 'None' and '0' do not limit the maximal amount of read bytes. Set 'size' = 'max_size' to read well defined and fixed number of bytes. Adapt ConsoleExpectMixin accordingly, and include 'max_size' as explict parameter. Adapt 'test_serialdriver' to test the 'max_size' parameter. Adapt 'test_externalconsoledriver' to test the 'max_size' parameter. Signed-off-by: Marc Roeoesli <marc.roeoesli@mt.com>
b4504ca to
f5226ed
Compare
|
I've squashed the commits together and made minor changes to the message. I've also removed the RFC tag. |
Extend read function of serialdriver and externalconsoledriver with 'max_size' argument that limits the number of read bytes to 'max_size'. Set 'size' = 'max_size' to read exactly 'size' bytes. The values 'None' and '0' result in an unlimited read.
Extend 'test_read' in test_serialdriver.py and test_externalconsoledriver.py to check 'max_size' argument.
Implement 'max_size' explicitely in consoleexpectmixin.
Checklist
Signed-off-by: Marc Roeoesli marc.roeoesli@mt.com