net: make CaptureMessage() mockable

Rename `CaptureMessage()` to `CaptureMessageToFile()` and introduce a
`std::function` variable called `CaptureMessage` whose value can be
changed by unit tests, should they need to inspect message contents.
This commit is contained in:
Vasil Dimov
2021-07-22 18:23:21 +02:00
parent 43868ba416
commit 3cb9d9c861
3 changed files with 23 additions and 3 deletions

View File

@ -20,7 +20,7 @@ LENGTH_SIZE = 4
MSGTYPE_SIZE = 12
def mini_parser(dat_file):
"""Parse a data file created by CaptureMessage.
"""Parse a data file created by CaptureMessageToFile.
From the data file we'll only check the structure.