From e25ac6400b6b5fe53dd8f29a908d3776fa131aa3 Mon Sep 17 00:00:00 2001 From: iron3oxide Date: Tue, 14 May 2024 15:15:20 +0200 Subject: [PATCH] feat: Add test for constructing type from string with multi underscore prefix --- tests/test_typeid.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_typeid.py b/tests/test_typeid.py index 2f4dd26..a5caedc 100644 --- a/tests/test_typeid.py +++ b/tests/test_typeid.py @@ -84,6 +84,16 @@ def test_construct_type_from_string_with_prefix_standalone() -> None: assert isinstance(typeid.suffix, str) +def test_construct_type_from_string_with_multi_underscore_prefix() -> None: + string = "double_prefix_00041061050r3gg28a1c60t3gf" + + typeid = TypeID.from_string(string) + + assert isinstance(typeid, TypeID) + assert typeid.prefix == "double_prefix" + assert isinstance(typeid.suffix, str) + + def test_construct_type_from_invalid_string() -> None: string = "invalid_string_to_typeid"