Fixed test for M1, added about command, closes #315

This commit is contained in:
Rhet Turnbull 2021-01-12 07:03:07 -08:00
parent 61f649e59d
commit 965e10e20f
8 changed files with 678 additions and 629 deletions

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2019 Rhet Turnbull Copyright (c) 2019-2021 Rhet Turnbull
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -112,6 +112,7 @@ Options:
-h, --help Show this message and exit. -h, --help Show this message and exit.
Commands: Commands:
about Print information about osxphotos including license.
albums Print out albums found in the Photos library. albums Print out albums found in the Photos library.
dump Print list of all photos & associated info from the Photos... dump Print list of all photos & associated info from the Photos...
export Export photos from the Photos database. export Export photos from the Photos database.

View File

@ -97,6 +97,7 @@ Alternatively, you can also run the command line utility like this: ``python3 -m
-h, --help Show this message and exit. -h, --help Show this message and exit.
Commands: Commands:
about Print information about osxphotos including license.
albums Print out albums found in the Photos library. albums Print out albums found in the Photos library.
dump Print list of all photos & associated info from the Photos... dump Print list of all photos & associated info from the Photos...
export Export photos from the Photos database. export Export photos from the Photos database.

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,8 @@ Constants used by osxphotos
import os.path import os.path
from datetime import datetime from datetime import datetime
OSXPHOTOS_URL = "https://github.com/RhetTbull/osxphotos"
# Time delta: add this to Photos times to get unix time # Time delta: add this to Photos times to get unix time
# Apple Epoch is Jan 1, 2001 # Apple Epoch is Jan 1, 2001
TIME_DELTA = (datetime(2001, 1, 1, 0, 0) - datetime(1970, 1, 1, 0, 0)).total_seconds() TIME_DELTA = (datetime(2001, 1, 1, 0, 0) - datetime(1970, 1, 1, 0, 0)).total_seconds()

View File

@ -1,3 +1,3 @@
""" version info """ """ version info """
__version__ = "0.39.16" __version__ = "0.39.17"

File diff suppressed because one or more lines are too long

View File

@ -692,6 +692,17 @@ def test_osxphotos_help_3():
assert "Invalid command: foo" in result.output assert "Invalid command: foo" in result.output
def test_about():
""" Test about """
from osxphotos.__main__ import about
runner = CliRunner()
cwd = os.getcwd()
result = runner.invoke(about, [])
assert result.exit_code == 0
assert "MIT License" in result.output
def test_query_uuid(): def test_query_uuid():
import json import json
import os import os
@ -1576,7 +1587,7 @@ def test_export_convert_to_jpeg():
files = glob.glob("*") files = glob.glob("*")
assert sorted(files) == sorted(CLI_EXPORT_FILENAMES_CONVERT_TO_JPEG) assert sorted(files) == sorted(CLI_EXPORT_FILENAMES_CONVERT_TO_JPEG)
large_file = pathlib.Path(CLI_EXPORT_CONVERT_TO_JPEG_LARGE_FILE) large_file = pathlib.Path(CLI_EXPORT_CONVERT_TO_JPEG_LARGE_FILE)
assert large_file.stat().st_size > 10000000 assert large_file.stat().st_size > 7000000
@pytest.mark.skipif( @pytest.mark.skipif(