def test_round_trip_bitpack_custom_location(custom_starting_location):
    # Run
    round_trip = bitpacking.round_trip(custom_starting_location)

    # Assert
    assert custom_starting_location == round_trip
def test_round_trip_bitpack_simple(simple_starting_location):
    # Run
    round_trip = bitpacking.round_trip(simple_starting_location)

    # Assert
    assert simple_starting_location == round_trip
def test_round_trip_float(value: float, metadata: dict):
    result = bitpacking.round_trip(bitpacking.BitPackFloat(value), metadata)
    assert result == value
示例#4
0
def test_round_trip_dataclass_for_test(value, reference):
    data = DataclassForTest(BitPackValueUsingReference(value))
    ref = DataclassForTest(BitPackValueUsingReference(reference))

    result = bitpacking.round_trip(data, {"reference": ref})
    assert result == data
def test_round_trip_bitpack_all_zero_items(all_zero_starting_resources):
    # Run
    round_trip = bitpacking.round_trip(all_zero_starting_resources)

    # Assert
    assert all_zero_starting_resources == round_trip
def test_round_trip_bitpack_simple(simple_starting_resources):
    # Run
    round_trip = bitpacking.round_trip(simple_starting_resources)

    # Assert
    assert simple_starting_resources == round_trip