Added --added-after, --added-before, --added-in-last, #439 (#683)

This commit is contained in:
Rhet Turnbull
2022-05-05 17:06:55 -07:00
committed by GitHub
parent 3ed658a7d0
commit 4533057142
7 changed files with 641 additions and 535 deletions

View File

@@ -1,5 +1,4 @@
""" Test the command line interface (CLI) """
import datetime
import glob
import json
@@ -7079,6 +7078,46 @@ def test_query_function():
assert json_got[0]["original_filename"] == "DSC03584.dng"
def test_query_added_after():
"""test query --added-after"""
runner = CliRunner()
cwd = os.getcwd()
# pylint: disable=not-context-manager
results = runner.invoke(
query,
[
os.path.join(cwd, PHOTOS_DB_15_7),
"--json",
"--added-after",
"2022-02-03",
],
)
assert results.exit_code == 0
json_got = json.loads(results.output)
assert len(json_got) == 4
def test_query_added_before():
"""test query --added-before"""
runner = CliRunner()
cwd = os.getcwd()
# pylint: disable=not-context-manager
results = runner.invoke(
query,
[
os.path.join(cwd, PHOTOS_DB_15_7),
"--json",
"--added-before",
"2019-07-28",
],
)
assert results.exit_code == 0
json_got = json.loads(results.output)
assert len(json_got) == 7
def test_export_export_dir_template():
"""Test {export_dir} template"""