4
4
from clang_tools import install_os
5
5
from clang_tools .install import clang_tools_binary_url
6
6
from clang_tools .util import check_install_os , download_file , get_sha_checksum
7
+ from clang_tools import release_tag
7
8
8
9
9
10
def test_check_install_os ():
@@ -13,12 +14,12 @@ def test_check_install_os():
13
14
14
15
15
16
@pytest .mark .parametrize (
16
- "tag" , ["master-be694ee7" , pytest .param ("latest" , marks = pytest .mark .xfail )]
17
+ "tag" , [release_tag , pytest .param ("latest" , marks = pytest .mark .xfail )]
17
18
)
18
19
def test_download_file (monkeypatch : pytest .MonkeyPatch , tmp_path : Path , tag : str ):
19
20
"""Test that deliberately fails to download a file."""
20
21
monkeypatch .chdir (str (tmp_path ))
21
- url = clang_tools_binary_url ("clang-format" , "12" , release_tag = tag )
22
+ url = clang_tools_binary_url ("clang-format" , "12" , tag = release_tag )
22
23
file_name = download_file (url , "file.tar.gz" , True )
23
24
assert file_name is not None
24
25
@@ -30,5 +31,5 @@ def test_get_sha(monkeypatch: pytest.MonkeyPatch):
30
31
expected = Path (f"clang-format-12_{ install_os } -amd64.sha512sum" ).read_text (
31
32
encoding = "utf-8"
32
33
)
33
- url = clang_tools_binary_url ("clang-format" , "12" , release_tag = "master-be694ee7" )
34
+ url = clang_tools_binary_url ("clang-format" , "12" , tag = release_tag )
34
35
assert get_sha_checksum (url ) == expected
0 commit comments