Skip to content

Commit e742259

Browse files
committed
Add a unit test
1 parent a36be75 commit e742259

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/python/unit/test_types.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# Copyright (C) 2025 Intel Corporation
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
from model_api.models.types import ListValue
7+
8+
9+
def test_string_list_parameter():
10+
str_list = ListValue(
11+
value_type=str,
12+
description="List of strings",
13+
default_value=["label1", "label2", "label3"],
14+
)
15+
assert str_list.value_type == str
16+
17+
parsed_list = str_list.from_str("1 2 3")
18+
19+
assert len(parsed_list) == 3
20+
assert type(parsed_list[0]) is str

0 commit comments

Comments
 (0)