Skip to content

Commit eb1b877

Browse files
authored
update data type lengths (#65)
1 parent e0fc000 commit eb1b877

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

sdk/basyx/aas/model/_string_constraints.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ def check(value: str, type_name: str, min_length: int = 0, max_length: Optional[
6464

6565

6666
def check_content_type(value: str, type_name: str = "ContentType") -> None:
67-
return check(value, type_name, 1, 100)
67+
return check(value, type_name, 1, 128)
6868

6969

7070
def check_identifier(value: str, type_name: str = "Identifier") -> None:
71-
return check(value, type_name, 1, 2000)
71+
return check(value, type_name, 1, 2048)
7272

7373

7474
def check_label_type(value: str, type_name: str = "LabelType") -> None:
@@ -84,7 +84,7 @@ def check_name_type(value: str, type_name: str = "NameType") -> None:
8484

8585

8686
def check_path_type(value: str, type_name: str = "PathType") -> None:
87-
return check(value, type_name, 1, 2000)
87+
return check(value, type_name, 1, 2048)
8888

8989

9090
def check_qualifier_type(value: str, type_name: str = "QualifierType") -> None:
@@ -100,7 +100,7 @@ def check_short_name_type(value: str, type_name: str = "ShortNameType") -> None:
100100

101101

102102
def check_value_type_iec61360(value: str, type_name: str = "ValueTypeIEC61360") -> None:
103-
return check(value, type_name, 1, 2000)
103+
return check(value, type_name, 1, 2048)
104104

105105

106106
def check_version_type(value: str, type_name: str = "VersionType") -> None:

sdk/test/model/test_string_constraints.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ def test_identifier(self) -> None:
1717
with self.assertRaises(ValueError) as cm:
1818
_string_constraints.check_identifier(identifier)
1919
self.assertEqual("Identifier has a minimum length of 1! (length: 0)", cm.exception.args[0])
20-
identifier = "a" * 2001
20+
identifier = "a" * 2049
2121
with self.assertRaises(ValueError) as cm:
2222
_string_constraints.check_identifier(identifier)
23-
self.assertEqual("Identifier has a maximum length of 2000! (length: 2001)", cm.exception.args[0])
24-
identifier = "a" * 2000
23+
self.assertEqual("Identifier has a maximum length of 2048! (length: 2049)", cm.exception.args[0])
24+
identifier = "a" * 2048
2525
_string_constraints.check_identifier(identifier)
2626

2727
def test_version_type(self) -> None:
@@ -73,8 +73,8 @@ def test_path_type_decoration(self) -> None:
7373
self.assertEqual("PathType has a minimum length of 1! (length: 0)", cm.exception.args[0])
7474
dc = self.DummyClass("a")
7575
with self.assertRaises(ValueError) as cm:
76-
dc.some_attr = "a" * 2001
77-
self.assertEqual("PathType has a maximum length of 2000! (length: 2001)", cm.exception.args[0])
76+
dc.some_attr = "a" * 2049
77+
self.assertEqual("PathType has a maximum length of 2048! (length: 2049)", cm.exception.args[0])
7878
self.assertEqual(dc.some_attr, "a")
7979

8080
def test_ignore_none_values(self) -> None:

0 commit comments

Comments
 (0)