]> kaliko git repositories - mpd-sima.git/commitdiff
Do not limit valid UUID to version 4
authorkaliko <kaliko@azylum.org>
Wed, 2 Jun 2021 15:31:16 +0000 (17:31 +0200)
committerkaliko <kaliko@azylum.org>
Wed, 2 Jun 2021 15:31:16 +0000 (17:31 +0200)
sima/lib/meta.py
tests/test_meta.py

index 26da9ca66efc05918a9c45b87a8de39ea08a345b..39b3197573c9e78456cdcbbfaf8f5854d90f18ae 100644 (file)
@@ -26,7 +26,7 @@ from collections.abc import Set
 import logging
 import re
 
-UUID_RE = r'^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$'
+UUID_RE = r'^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[89AB][a-f0-9]{3}-[a-f0-9]{12}$'
 # The Track Object is collapsing multiple tags into a single string using this
 # separator. It is used then to split back the string to tags list.
 SEPARATOR = chr(0x1F)  # ASCII Unit Separator
index ed241cf1a04f85f9c2ee4db53d1ad148a1f3ef1d..783f647f52c971565b49816239b296c337c09173 100644 (file)
@@ -13,7 +13,6 @@ class TestMetaObject(unittest.TestCase):
         wrong = VALID +'a'
         self.assertFalse(is_uuid4(wrong))
         #  test UUID4 format validation
-        self.assertFalse(is_uuid4(VALID.replace('4', '3')))
         self.assertFalse(is_uuid4(VALID.replace('a', 'z')))
 
     def test_init(self):