-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add coverage reporting to tests and GitHub actions. Also fix a problem with analyzing tar balls. `suffix` only contains the last suffix. Signed-off-by: Christian Heimes <cheimes@redhat.com>
- Loading branch information
Showing
5 changed files
with
132 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pathlib | ||
import subprocess | ||
import sys | ||
import tarfile | ||
import zipfile | ||
|
||
|
||
def test_main_binary() -> None: | ||
python = pathlib.Path(sys.executable).resolve() | ||
out = subprocess.check_output(["elfdeps", python], text=True) | ||
assert str(python) in out | ||
|
||
|
||
def test_main_tarfile(tmp_path: pathlib.Path): | ||
tname = tmp_path / "test.tar.gz" | ||
python = pathlib.Path(sys.executable).resolve() | ||
with tarfile.TarFile.open(tname, mode="w:gz") as tf: | ||
# FIXME: remove '.so' suffix | ||
tf.add(python, "python-binary.so") | ||
tf.add(__file__, "test.py") | ||
out = subprocess.check_output(["elfdeps", str(tname)], text=True) | ||
assert "python-binary" in out | ||
|
||
|
||
def test_main_zipfile(tmp_path: pathlib.Path) -> None: | ||
zname = tmp_path / "test.zip" | ||
python = pathlib.Path(sys.executable).resolve() | ||
with zipfile.ZipFile(zname, mode="w") as zf: | ||
# FIXME: remove '.so' suffix | ||
zf.write(python, "python-binary.so") | ||
zf.write(__file__, "test.py") | ||
out = subprocess.check_output(["elfdeps", str(zname)], text=True) | ||
assert "python-binary" in out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters