Skip to content

Tests for ByteBuffer class #23

@nicole-mcg

Description

@nicole-mcg

There should be tests for the ByteBuffer class in file_server/io/byte_buffer.py.

Here are some tests that should be included:

  • One ByteBuffer with each of the different data types written to it, then create a new ByteBuffer via ByteBuffer(byte_buffer.bytes()) and verify the data is correct when read back. This could be parameterized with pytest.mark.parameterize to test different combinations of data types in different orders
  • Each of the from_### methods in ByteBuffer should be fed back into a ByteBuffer to read it. This can be done with pytest.mark.parameterize and 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

No one assigned

    Labels

    back endPythonstructureThis will make something more clear and less prone to programming errors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions