Added shortuuid, #314
This commit is contained in:
@@ -191,6 +191,8 @@ TEMPLATE_VALUES = {
|
||||
"{place.address.country}": "United States",
|
||||
"{place.address.country_code}": "US",
|
||||
"{uuid}": "128FB4C6-0B16-4E7D-9108-FB2E90DA1546",
|
||||
"{shortuuid}": "5KFgrKKnwmnN99jkHmJP8M",
|
||||
"{shortuuid|sslice(:7)}": "5KFgrKK",
|
||||
"{exif.camera_make}": "Apple",
|
||||
"{exif.camera_model}": "iPhone 6s",
|
||||
"{exif.lens_model}": "iPhone 6s back camera 4.15mm f/2.2",
|
||||
|
||||
@@ -15,9 +15,11 @@ UTI_DICT = {"public.jpeg": "jpeg", "com.canon.cr2-raw-image": "cr2"}
|
||||
|
||||
from osxphotos.utils import (
|
||||
_dd_to_dms,
|
||||
increment_filename,
|
||||
increment_filename_with_count,
|
||||
increment_filename,
|
||||
list_directory,
|
||||
shortuuid_to_uuid,
|
||||
uuid_to_shortuuid,
|
||||
)
|
||||
|
||||
|
||||
@@ -136,3 +138,11 @@ def test_increment_filename():
|
||||
str(temp_dir / "file2 (3).jpg"),
|
||||
3,
|
||||
)
|
||||
|
||||
|
||||
def test_shortuuid_uuid():
|
||||
"""Test shortuuid_to_uuid and uuid_to_shortuuid"""
|
||||
uuid = "5CF8D91E-DCEB-4CC3-BFF7-920B05564EB0"
|
||||
shortuuid = "JYsxugP9UjetmCbBCHXcmu"
|
||||
assert uuid_to_shortuuid(uuid) == shortuuid
|
||||
assert shortuuid_to_uuid(shortuuid) == uuid
|
||||
|
||||
Reference in New Issue
Block a user