Ë
    	]jÿ  ã                   ó$   — d dl mZ  G d„ d«      Zy)é    )ÚHotkeysSerializerc                   ó:   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
y	)
ÚTestHotkeysSerializerzTests for the HotkeysSerializerc                 ól   — dddœdddœddidddœd	œ}d
|i}t        |¬«      }|j                  «       sJ ‚y)zá
        Test serializer accepts valid hotkeys data.

        Validates that the serializer correctly processes a dictionary of hotkeys
        with proper action key format (namespace:action) and valid key bindings.
        úctrl+sT©ÚkeyÚactivezctrl+oFr	   zctrl+xzalt+h)úeditor:savezeditor:openz
editor:cutznavigation:homeÚcustom_hotkeys©ÚdataN)r   Úis_valid)ÚselfÚvalid_hotkeysÚserializer_dataÚ
serializers       úZ/root/env/lib/python3.12/site-packages/label_studio/users/tests/test_hotkeys_serializer.pyÚtest_valid_dataz%TestHotkeysSerializer.test_valid_data   sS   € ð $,°tÑ<Ø#+°uÑ=Ø  (Ð+Ø'.¸$Ñ?ñ	
ˆð ,¨]Ð;ˆÜ&¨OÔ<ˆ
à×"Ñ"Ô$Ð$Ñ$ó    c                 ój   — ddgi}t        |¬«      }|j                  «       rJ ‚d|j                  v sJ ‚y)zÚ
        Test serializer rejects non-dictionary custom_hotkeys.

        Validates that the serializer enforces the custom_hotkeys field
        to be a dictionary type and rejects other data types like lists.
        r   znot a dictionaryr   N©r   r   Úerrors)r   r   r   s      r   Útest_invalid_format_not_dictz2TestHotkeysSerializer.test_invalid_format_not_dict   sB   € ð !Ð#5Ð"6Ð7ˆÜ&¨DÔ1ˆ
à×&Ñ&Ô(Ð(Ð(Ø :×#4Ñ#4Ñ4Ð4Ñ4r   c                 óp   — ddddiii}t        |¬«      }|j                  «       rJ ‚d|j                  v sJ ‚y)zâ
        Test serializer rejects action keys without proper format.

        Validates that action keys must follow the namespace:action format
        and rejects keys that don't contain the required colon separator.
        r   Ú
editorsaver	   r   r   Nr   ©r   Úinvalid_datar   s      r   Útest_invalid_action_key_formatz4TestHotkeysSerializer.test_invalid_action_key_format'   sH   € ð )¨<¸%ÀÐ9JÐ*KÐLˆÜ&¨LÔ9ˆ
à×&Ñ&Ô(Ð(Ð(Ø :×#4Ñ#4Ñ4Ð4Ñ4r   c                 óp   — ddddiii}t        |¬«      }|j                  «       rJ ‚d|j                  v sJ ‚y)z¾
        Test serializer rejects empty action keys.

        Validates that action keys cannot be empty strings and must
        contain meaningful namespace and action identifiers.
        r   Ú r	   r   r   Nr   r   s      r   Útest_empty_action_keyz+TestHotkeysSerializer.test_empty_action_key4   sH   € ð )¨2°°xÐ/@Ð*AÐBˆÜ&¨LÔ9ˆ
à×&Ñ&Ô(Ð(Ð(Ø :×#4Ñ#4Ñ4Ð4Ñ4r   c                 óp   — ddddiii}t        |¬«      }|j                  «       rJ ‚d|j                  v sJ ‚y)zÒ
        Test serializer rejects hotkey data without required 'key' field.

        Validates that each hotkey configuration must include a 'key' field
        specifying the keyboard shortcut binding.
        r   r   r
   Tr   Nr   r   s      r   Útest_missing_key_in_hotkey_dataz5TestHotkeysSerializer.test_missing_key_in_hotkey_dataA   sH   € ð )¨=¸8ÀTÐ:JÐ*KÐLˆÜ&¨LÔ9ˆ
à×&Ñ&Ô(Ð(Ð(Ø :×#4Ñ#4Ñ4Ð4Ñ4r   c                 óp   — ddddiii}t        |¬«      }|j                  «       rJ ‚d|j                  v sJ ‚y)z¿
        Test serializer rejects invalid key values.

        Validates that the 'key' field cannot be empty and must contain
        a valid keyboard shortcut string representation.
        r   r   r	   r!   r   Nr   r   s      r   Útest_invalid_key_valuez,TestHotkeysSerializer.test_invalid_key_valueN   sG   € ð )¨=¸5À"¸+Ð*FÐGˆÜ&¨LÔ9ˆ
à×&Ñ&Ô(Ð(Ð(Ø :×#4Ñ#4Ñ4Ð4Ñ4r   c                 ór   — dddddœii}t        |¬«      }|j                  «       rJ ‚d|j                  v sJ ‚y)zÒ
        Test serializer rejects non-boolean active flags.

        Validates that the optional 'active' field must be a boolean value
        when present, rejecting string or other non-boolean types.
        r   r   r   Úyesr   r   Nr   r   s      r   Útest_invalid_active_flagz.TestHotkeysSerializer.test_invalid_active_flag[   sI   € ð )¨=À(ÐV[Ñ:\Ð*]Ð^ˆÜ&¨LÔ9ˆ
à×&Ñ&Ô(Ð(Ð(Ø :×#4Ñ#4Ñ4Ð4Ñ4r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r"   r$   r&   r)   © r   r   r   r      s(   „ Ù)ò%ò&5ò5ò5ò5ò5ó5r   r   N)Úusers.serializersr   r   r.   r   r   ú<module>r0      s   ðÝ /÷b5ò b5r   