mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-04-30 19:21:33 +00:00
refactor: refactor some functions
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from adetailer.args import ALL_ARGS, ADetailerArgs
|
||||
|
||||
|
||||
@@ -12,3 +14,21 @@ def test_all_args() -> None:
|
||||
if attr == "is_api":
|
||||
continue
|
||||
assert attr in ALL_ARGS.attrs, attr
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("ad_model", "expect"),
|
||||
[("mediapipe_face_full", True), ("face_yolov8n.pt", False)],
|
||||
)
|
||||
def test_is_mediapipe(ad_model: str, expect: bool) -> None:
|
||||
args = ADetailerArgs(ad_model=ad_model)
|
||||
assert args.is_mediapipe() is expect
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("ad_model", "expect"),
|
||||
[("mediapipe_face_full", False), ("face_yolov8n.pt", False), ("None", True)],
|
||||
)
|
||||
def test_need_skip(ad_model: str, expect: bool) -> None:
|
||||
args = ADetailerArgs(ad_model=ad_model)
|
||||
assert args.need_skip() is expect
|
||||
|
||||
Reference in New Issue
Block a user