mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-18 13:14:37 +03:00
Add test for Settings class
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
@@ -41,3 +41,21 @@ def test_helper_altlink(monkeypatch):
|
|||||||
alt = "http://mirrors.geekpie.club/boo.7z"
|
alt = "http://mirrors.geekpie.club/boo.7z"
|
||||||
newurl = helper.altlink(url, alt)
|
newurl = helper.altlink(url, alt)
|
||||||
assert newurl.startswith("http://ftp.jaist.ac.jp/")
|
assert newurl.startswith("http://ftp.jaist.ac.jp/")
|
||||||
|
|
||||||
|
|
||||||
|
def test_settings(tmp_path):
|
||||||
|
config_path = tmp_path.joinpath("settings.ini")
|
||||||
|
with open(config_path, "w") as f:
|
||||||
|
f.write(
|
||||||
|
"""\
|
||||||
|
[DEFAULTS]
|
||||||
|
|
||||||
|
[aqt]
|
||||||
|
concurrency: 3
|
||||||
|
|
||||||
|
[mirrors]
|
||||||
|
blacklist: ['http://mirrors.ustc.edu.cn', 'http://mirrors.tuna.tsinghua.edu.cn', 'http://mirrors.geekpie.club']"""
|
||||||
|
)
|
||||||
|
config = helper.Settings(config_path)
|
||||||
|
assert config.concurrency == 3
|
||||||
|
assert "http://mirrors.ustc.edu.cn" in config.blacklist
|
||||||
|
|||||||
Reference in New Issue
Block a user