Skip to content

Commit 4bbfdfd

Browse files
committed
fix pytest failed
1 parent f7ba31b commit 4bbfdfd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/test_util.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
import os
2+
import shutil
23
from clang_tools.util import check_os, download_file, unpack_file
34

5+
TEST_REPO = "https://github.com/cpp-linter/cpp-linter-action"
6+
47
def test_check_os():
58
system = check_os()
69
assert system in ("linux", "windos", "macosx")
710

811
def test_download_file():
9-
url = "https://github.com/shenxianpeng/shenxianpeng/blob/master/README.md"
12+
url = f"{TEST_REPO}/blob/master/README.md"
1013
file_name = "test_file"
1114
download_file(url, file_name)
1215
assert os.path.exists(file_name)
1316
os.remove(file_name)
1417
assert not os.path.exists(file_name)
1518

1619
def test_unpack_file():
17-
url = "https://github.com/shenxianpeng/shenxianpeng/archive/refs/heads/master.zip"
18-
file_name = "test_file.zip"
20+
url = f"{TEST_REPO}/archive/refs/tags/v1.4.4.tar.gz"
21+
file_name = "test_file.tar.gz"
1922
download_file(url, file_name)
2023
status = unpack_file(file_name)
2124
assert status == 0
22-
os.remove(file_name)
25+
os.remove(file_name)
26+
shutil.rmtree("cpp-linter-action-1.4.4")

0 commit comments

Comments
 (0)