MCPcopy Create free account
hub / github.com/bloomberg/pystack / test_maps_for_binary_invalid_executable

Function test_maps_for_binary_invalid_executable

tests/unit/test_maps.py:946–977  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

944
945
946def test_maps_for_binary_invalid_executable():
947 # GIVEN
948
949 python = VirtualMap(
950 start=140728765599744,
951 end=140728765603840,
952 filesize=4096,
953 offset=0,
954 device="00:00",
955 flags="r-xp",
956 inode=0,
957 path=Path("the_executable"),
958 )
959
960 maps = [
961 python,
962 VirtualMap(
963 start=18446744073699065856,
964 end=18446744073699069952,
965 filesize=4096,
966 offset=0,
967 device="00:00",
968 flags="--xp",
969 inode=0,
970 path=Path("/usr/lib/libc-2.31.so"),
971 ),
972 ]
973
974 # WHEN
975
976 with pytest.raises(MissingExecutableMaps, match="the_executable"):
977 parse_maps_file_for_binary(Path("other_executable"), maps)
978
979
980def test_maps_for_binary_invalid_executable_and_no_available_maps():

Callers

nothing calls this directly

Calls 2

VirtualMapClass · 0.90

Tested by

no test coverage detected