1515import pytest
1616from pytest import MonkeyPatch
1717
18+ from science import a_scie
1819from science .hashing import Digest
19- from science .platform import CURRENT_PLATFORM_SPEC , Platform
20+ from science .platform import CURRENT_PLATFORM_SPEC , Platform , PlatformSpec
2021from science .providers import PyPy
2122
2223
@@ -71,13 +72,15 @@ def read_data():
7172
7273
7374def assert_download_mirror (
74- tmp_path : Path , current_platform : Platform , * , download_dir : Path , download_url : str
75+ tmp_path : Path , current_platform_spec : PlatformSpec , * , download_dir : Path , download_url : str
7576) -> None :
7677 subprocess .run (args = ["science" , "download" , "ptex" , download_dir ], check = True )
7778 subprocess .run (args = ["science" , "download" , "scie-jump" , download_dir ], check = True )
7879
7980 lift_manifest = tmp_path / "lift.toml"
80- scie_jump_qualified_binary_name = current_platform .qualified_binary_name ("scie-jump" )
81+ scie_jump_qualified_binary_name = a_scie .qualify_binary_name (
82+ "scie-jump" , platform_spec = current_platform_spec
83+ )
8184 lift_manifest .write_text (
8285 dedent (
8386 f"""\
@@ -99,31 +102,33 @@ def assert_download_mirror(
99102 )
100103 subprocess .run (args = ["science" , "lift" , "build" , lift_manifest ], cwd = tmp_path , check = True )
101104
102- scie = tmp_path / current_platform .binary_name ("mirror" )
105+ scie = tmp_path / current_platform_spec .binary_name ("mirror" )
103106 split_dir = tmp_path / "split"
104107 subprocess .run (args = [scie , split_dir ], env = {** os .environ , "SCIE" : "split" }, check = True )
105108 subprocess .run (args = [scie ], cwd = tmp_path , check = True )
106109
107110 assert Digest .hash (tmp_path / scie_jump_qualified_binary_name ) == Digest .hash (
108- split_dir / current_platform .binary_name ("scie-jump" )
111+ split_dir / current_platform_spec .binary_name ("scie-jump" )
109112 )
110113
111114
112- def test_download_http_mirror (tmp_path : Path , current_platform : Platform , server : Server ) -> None :
115+ def test_download_http_mirror (
116+ tmp_path : Path , current_platform_spec : PlatformSpec , server : Server
117+ ) -> None :
113118 assert_download_mirror (
114- tmp_path , current_platform , download_dir = server .root , download_url = server .url
119+ tmp_path , current_platform_spec , download_dir = server .root , download_url = server .url
115120 )
116121
117122
118- def test_download_file_mirror (tmp_path : Path , current_platform : Platform ) -> None :
123+ def test_download_file_mirror (tmp_path : Path , current_platform_spec : PlatformSpec ) -> None :
119124 download_dir = tmp_path / "download-dir"
120125 download_dir_url = (
121126 f"file:///{ download_dir .as_posix ()} "
122- if current_platform .is_windows
127+ if current_platform_spec .is_windows
123128 else f"file://{ download_dir } "
124129 )
125130 assert_download_mirror (
126- tmp_path , current_platform , download_dir = download_dir , download_url = download_dir_url
131+ tmp_path , current_platform_spec , download_dir = download_dir , download_url = download_dir_url
127132 )
128133
129134
0 commit comments