-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* reworked the downloader * resolver fixes * ruff fixes * Final downloader fixes
- Loading branch information
1 parent
9440232
commit c6ce880
Showing
5 changed files
with
125 additions
and
109 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,32 @@ | ||
import os | ||
import shutil | ||
import pytest | ||
|
||
from .utils import download_tinytex # noqa | ||
import pytinytex | ||
|
||
def test_successful_download(download_tinytex): # noqa | ||
def test_successful_download(): # noqa | ||
pytinytex.download_tinytex(variation=0, target_folder="tests/tinytex_distribution", download_folder="tests") | ||
assert os.path.isdir(os.path.join("tests", "tinytex_distribution")) | ||
assert os.path.isdir(os.path.join("tests", "tinytex_distribution", "bin")) | ||
shutil.rmtree(os.path.join("tests", "tinytex_distribution")) | ||
for item in os.listdir("tests"): | ||
if item.endswith(".zip") or item.endswith(".tar.gz") or item.endswith(".tgz"): | ||
os.remove(os.path.join("tests", item)) | ||
|
||
def test_bin_is_in_distribution(download_tinytex): # noqa | ||
def test_successful_download_specific_version(): | ||
pytinytex.download_tinytex(variation=0, version="2024.12", target_folder="tests/tinytex_distribution", download_folder="tests") | ||
assert os.path.isdir(os.path.join("tests", "tinytex_distribution")) | ||
assert os.path.isdir(os.path.join("tests", "tinytex_distribution", "bin")) | ||
shutil.rmtree(os.path.join("tests", "tinytex_distribution")) | ||
# delete any files in the test dir that ends with zip, gz or tgz | ||
for item in os.listdir("tests"): | ||
if item.endswith(".zip") or item.endswith(".tar.gz") or item.endswith(".tgz"): | ||
os.remove(os.path.join("tests", item)) | ||
|
||
def test_failing_download_invalid_variation(): | ||
with pytest.raises(RuntimeError, match="Invalid TinyTeX variation 999."): | ||
pytinytex.download_tinytex(variation=999) | ||
|
||
def test_failing_download_invalid_version(): | ||
with pytest.raises(RuntimeError, match="Invalid TinyTeX version invalid."): | ||
pytinytex.download_tinytex(version="invalid") |
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