Skip to content

Commit

Permalink
Add unit tests for is_dynamic_elf() (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathonReinhart committed Jan 14, 2024
1 parent ee54169 commit 77ccfa5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions unittest/test_elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,15 @@ def test_raspios(self):
"/lib/ld-linux-armhf.so.3",
]
self._test(output, exp)


def test_is_dynamic_elf_handles_non_elf():
with NamedTemporaryFile('wb', suffix='.bin') as f:
f.write(b"\x11\x22\x33\x44")
f.flush()

assert not elf.is_dynamic_elf(f.name)


def test_is_dynamic_elf_handles_elf():
assert elf.is_dynamic_elf("/bin/true")

0 comments on commit 77ccfa5

Please sign in to comment.