-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
back endPythonPythonstructureThis will make something more clear and less prone to programming errorsThis will make something more clear and less prone to programming errors
Description
There should be tests for the ByteBuffer class in file_server/io/byte_buffer.py.
Here are some tests that should be included:
- One
ByteBufferwith each of the different data types written to it, then create a newByteBufferviaByteBuffer(byte_buffer.bytes())and verify the data is correct when read back. This could be parameterized withpytest.mark.parameterizeto test different combinations of data types in different orders - Each of the
from_###methods inByteBuffershould be fed back into aByteBufferto read it. This can be done withpytest.mark.parameterizeand could be one line:
E.g
from_method=ByteBuffer.from_string
var_to_test="test"
read_method="read_string"
assert getattr(ByteBuffer(from_method(var_to_test)), read_method)() == var_to_test
An example test can be found at file_server/file/__test__/test_snapshot.py
Test naming conventions: https://pytest.readthedocs.io/en/reorganize-docs/new-docs/user/naming_conventions.html
Metadata
Metadata
Assignees
Labels
back endPythonPythonstructureThis will make something more clear and less prone to programming errorsThis will make something more clear and less prone to programming errors