diff --git a/tests/vspec/test_static_uids/test_static_uids.py b/tests/vspec/test_static_uids/test_static_uids.py index 64d3ab5e..2aa8a6c5 100644 --- a/tests/vspec/test_static_uids/test_static_uids.py +++ b/tests/vspec/test_static_uids/test_static_uids.py @@ -83,11 +83,11 @@ def change_test_dir(request, monkeypatch): @pytest.mark.parametrize( "node_name, unit, datatype, allowed, minimum, maximum, result_static_uid", [ - ("TestNode", "m", VSSDataType.UINT16, "", 0, 10000, "156365B2"), - ("TestNode", "mm", VSSDataType.UINT32, "", "", "", "0931A8FA"), - ("TestUnit", "degrees/s", VSSDataType.FLOAT, "", "", "", "C733138C"), - ("TestMinMax", "percent", VSSDataType.UINT8, "", 0, 100, "72A24EF1"), - ("TestEnum", "m", VSSDataType.STRING, ["YES, NO"], "", "", "DEA50110"), + ("TestNode", "m", VSSDataType.UINT16, "", 0, 10000, "A1D565B2"), + ("TestNode", "mm", VSSDataType.UINT32, "", "", "", "B5D7A8FA"), + ("TestUnit", "degrees/s", VSSDataType.FLOAT, "", "", "", "DEA9138C"), + ("TestMinMax", "percent", VSSDataType.UINT8, "", 0, 100, "88FC5491"), + ("TestEnum", "m", VSSDataType.STRING, ["YES, NO"], "", "", "06AEB370"), ], ) def test_generate_id( diff --git a/tests/vspec/test_static_uids/validation.yaml b/tests/vspec/test_static_uids/validation.yaml index f41d1de2..ee6c6b7e 100644 --- a/tests/vspec/test_static_uids/validation.yaml +++ b/tests/vspec/test_static_uids/validation.yaml @@ -1,15 +1,15 @@ A: description: A is a test node - staticUID: '0x6865518C' + staticUID: '0x5B38F4AC' type: branch A.B: description: B is a branch of A - staticUID: '0x5EE0702C' + staticUID: '0x4687862C' type: branch A.B.Int32: datatype: int32 description: A.B.Int32 is a leaf of A.B of datatype int32 - staticUID: '0x4322A0BF' + staticUID: '0xF59053DF' type: sensor unit: rpm A.B.IsLeaf: @@ -18,20 +18,20 @@ A.B.IsLeaf: - 'NO' datatype: string description: This node is a leaf of the tree and it has allowed values (aka an enum). - staticUID: '0x51887178' + staticUID: '0x41EF3218' type: actuator A.B.Max: datatype: uint8 description: A leaf that uses a maximum value. max: 100 - staticUID: '0xACFF72AC' + staticUID: '0xCF708DCC' type: sensor unit: percent A.B.Min: datatype: uint8 description: A leaf that uses a minimum value. min: 10 - staticUID: '0xF66F948E' + staticUID: '0x2FC6BA2E' type: sensor unit: percent A.B.NewName: @@ -40,29 +40,29 @@ A.B.NewName: fka: - A.B.OldName - A.B.OlderName - staticUID: '0x63C22EF6' + staticUID: '0x126503B6' type: sensor unit: mm A.Float: datatype: float description: A.Float is a leaf of A of datatype float - staticUID: '0xC83DDDBF' + staticUID: '0xA493DFBF' type: actuator unit: mm A.Int16: datatype: int16 description: A.Int16 is a leaf of A of datatype int16 - staticUID: '0xC50253A3' + staticUID: '0x3D9D89A3' type: sensor unit: rpm A.String: datatype: string deprecation: This is test deprecation, let's say it used to be called Str instead String. description: A.String is a leaf of A of datatype string - staticUID: '0x215470FC' + staticUID: '0x49A622FC' type: sensor A.StringArray: datatype: string[] description: A.StringArray is a leaf of A of datatype string array - staticUID: '0x2115794B' + staticUID: '0xE8A4A62B' type: sensor diff --git a/tests/vspec/test_static_uids/validation_vspecs/validation.vspec b/tests/vspec/test_static_uids/validation_vspecs/validation.vspec index 3b51fdaa..065f3e76 100644 --- a/tests/vspec/test_static_uids/validation_vspecs/validation.vspec +++ b/tests/vspec/test_static_uids/validation_vspecs/validation.vspec @@ -8,16 +8,16 @@ A: description: A is a test node - staticUID: '0x6865518C' + staticUID: '0x5B38F4AC' type: branch A.B: description: B is a branch of A - staticUID: '0x5EE0702C' + staticUID: '0x4687862C' type: branch A.B.Int32: datatype: int32 description: A.B.Int32 is a leaf of A.B of datatype int32 - staticUID: '0x4322A0BF' + staticUID: '0xF59053DF' type: sensor unit: rpm A.B.IsLeaf: @@ -26,20 +26,20 @@ A.B.IsLeaf: - 'NO' datatype: string description: This node is a leaf of the tree and it has allowed values (aka an enum). - staticUID: '0x51887178' + staticUID: '0x41EF3218' type: actuator A.B.Max: datatype: uint8 description: A leaf that uses a maximum value. max: 100 - staticUID: '0xACFF72AC' + staticUID: '0xCF708DCC' type: sensor unit: percent A.B.Min: datatype: uint8 description: A leaf that uses a minimum value. min: 10 - staticUID: '0xF66F948E' + staticUID: '0x2FC6BA2E' type: sensor unit: percent A.B.NewName: @@ -48,29 +48,30 @@ A.B.NewName: fka: - A.B.OldName - A.B.OlderName - staticUID: '0x63C22EF6' + staticUID: '0x126503B6' type: sensor unit: mm A.Float: datatype: float description: A.Float is a leaf of A of datatype float - staticUID: '0xC83DDDBF' + staticUID: '0xA493DFBF' type: actuator unit: mm A.Int16: datatype: int16 description: A.Int16 is a leaf of A of datatype int16 - staticUID: '0xC50253A3' + staticUID: '0x3D9D89A3' type: sensor unit: rpm A.String: datatype: string - deprecation: This is test deprecation, let's say it used to be called Str instead String. + deprecation: This is test deprecation, let's say it used to be called Str instead + String. description: A.String is a leaf of A of datatype string - staticUID: '0x215470FC' + staticUID: '0x49A622FC' type: sensor A.StringArray: datatype: string[] description: A.StringArray is a leaf of A of datatype string array - staticUID: '0x2115794B' + staticUID: '0xE8A4A62B' type: sensor diff --git a/tests/vspec/test_static_uids/validation_vspecs/validation_semantic_change.vspec b/tests/vspec/test_static_uids/validation_vspecs/validation_semantic_change.vspec index 2f36dd65..2c7b8007 100644 --- a/tests/vspec/test_static_uids/validation_vspecs/validation_semantic_change.vspec +++ b/tests/vspec/test_static_uids/validation_vspecs/validation_semantic_change.vspec @@ -8,16 +8,16 @@ A: description: A is a test node - staticUID: '0x6865518C' + staticUID: '0x5B38F4AC' type: branch A.B: description: B is a branch of A - staticUID: '0x5EE0702C' + staticUID: '0x4687862C' type: branch A.B.Int32: datatype: int32 description: A.B.Int32 is a leaf of A.B of datatype int32 - staticUID: '0x4322A0BF' + staticUID: '0xF59053DF' type: sensor unit: rpm A.B.IsLeaf: @@ -26,20 +26,20 @@ A.B.IsLeaf: - 'NO' datatype: string description: This node is a leaf of the tree and it has allowed values (aka an enum). - staticUID: '0x51887178' + staticUID: '0x41EF3218' type: actuator A.B.Max: datatype: uint8 description: A leaf that uses a maximum value. max: 100 - staticUID: '0xACFF72AC' + staticUID: '0xCF708DCC' type: sensor unit: percent A.B.Min: datatype: uint8 description: A leaf that uses a minimum value. min: 10 - staticUID: '0xF66F948E' + staticUID: '0x2FC6BA2E' type: sensor unit: percent A.B.OldName: @@ -47,28 +47,30 @@ A.B.OldName: description: A.B.NewName's old name is 'OldName'. And its even older name is 'OlderName'. fka: - A.B.OlderName - staticUID: '0xD4DFF5FD' + staticUID: '0x8B7DE17D' type: sensor unit: mm A.Float: datatype: float description: A.Float is a leaf of A of datatype float - staticUID: '0xC83DDDBF' + staticUID: '0xA493DFBF' type: actuator unit: mm A.Int16: datatype: int16 description: A.Int16 is a leaf of A of datatype int16 - staticUID: '0xC50253A3' + staticUID: '0x3D9D89A3' type: sensor unit: rpm A.String: datatype: string + deprecation: This is test deprecation, let's say it used to be called Str instead + String. description: A.String is a leaf of A of datatype string - staticUID: '0x215470FC' + staticUID: '0x49A622FC' type: sensor A.StringArray: datatype: string[] description: A.StringArray is a leaf of A of datatype string array - staticUID: '0x2115794B' + staticUID: '0xE8A4A62B' type: sensor diff --git a/vspec/utils/idgen_utils.py b/vspec/utils/idgen_utils.py index bcea2cf7..cd9fd85e 100644 --- a/vspec/utils/idgen_utils.py +++ b/vspec/utils/idgen_utils.py @@ -35,7 +35,7 @@ def get_node_identifier_bytes( f"allowed: {allowed}" f"min: {minimum}" f"max: {maximum}" - ).encode("utf-8") + ).encode("utf-8").lower() def fnv1_32_hash(identifier: bytes) -> int: