def test_can_access_layer(icmp_packet, access_func):
    """Tests that layer access in various ways works the same way."""
    assert access_func(icmp_packet).layer_name.upper() == 'ICMP'
    assert binascii.unhexlify(access_func(icmp_packet).data) == b'abcdefghijklmnopqrstuvwabcdefghi'
Tests that layer access in various ways works the same way.
tests/test_packet_operations.py