Skip to content

Commit 76a8033

Browse files
committed
DM-48065 : fix typing
1 parent 1073b48 commit 76a8033

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

tests/cli/test_others.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ async def test_others_cli(uvicorn: UvicornProcess, api_version: str) -> None:
2222
assert len(check) == 0
2323

2424
result = runner.invoke(client_top, "product_set list --output yaml")
25-
check = check_and_parse_result(result, list[models.ProductSet]) # type: ignore
26-
assert len(check) == 0
25+
products = check_and_parse_result(result, list[models.ProductSet])
26+
assert len(products) == 0
2727

2828
result = runner.invoke(client_top, "script_dependency list --output yaml")
29-
check = check_and_parse_result(result, list[models.Dependency]) # type: ignore
30-
assert len(check) == 0
29+
dependencies = check_and_parse_result(result, list[models.Dependency])
30+
assert len(dependencies) == 0
3131

3232
result = runner.invoke(client_top, "script_error list --output yaml")
33-
check = check_and_parse_result(result, list[models.ScriptError]) # type: ignore
34-
assert len(check) == 0
33+
scripts = check_and_parse_result(result, list[models.ScriptError])
34+
assert len(scripts) == 0
3535

3636
result = runner.invoke(client_top, "task_set list --output yaml")
37-
check = check_and_parse_result(result, list[models.TaskSet]) # type: ignore
38-
assert len(check) == 0
37+
tasks = check_and_parse_result(result, list[models.TaskSet])
38+
assert len(tasks) == 0
3939

4040
result = runner.invoke(client_top, "wms_task_report list --output yaml")
41-
check = check_and_parse_result(result, list[models.WmsTaskReport]) # type: ignore
42-
assert len(check) == 0
41+
reports = check_and_parse_result(result, list[models.WmsTaskReport])
42+
assert len(reports) == 0

tests/cli/util_functions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from lsst.cmservice.common.enums import LevelEnum, StatusEnum
1111

1212
T = TypeVar("T")
13+
E = TypeVar("E", models.Group, models.Campaign, models.Step, models.Job)
1314

1415

1516
def check_and_parse_result(
@@ -412,15 +413,15 @@ def check_scripts(
412413
def check_get_methods(
413414
runner: CliRunner,
414415
client_top: BaseCommand,
415-
entry: models.ElementMixin,
416+
entry: E,
416417
entry_class_name: str,
417418
entry_class: TypeAlias = models.ElementMixin,
418419
) -> None:
419420
result = runner.invoke(client_top, f"{entry_class_name} get all --output yaml --row_id {entry.id}")
420421
check_get = check_and_parse_result(result, entry_class)
421422

422423
assert check_get.id == entry.id, "pulled row should be identical"
423-
assert check_get.level == entry.level, "pulled row db_id should be identical" # type: ignore
424+
assert check_get.level == entry.level, "pulled row db_id should be identical"
424425

425426
result = runner.invoke(client_top, f"{entry_class_name} get by_name --output yaml --name {entry.name}")
426427
check_get = check_and_parse_result(result, entry_class)

0 commit comments

Comments
 (0)