Feature orphans (#755)
* Initial implementation of orphan command * Implemented orphans command, #84
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 541 KiB |
35
tests/test_cli_orphans.py
Normal file
35
tests/test_cli_orphans.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""Test `osxphotos orphan` CLI"""
|
||||
|
||||
import os.path
|
||||
|
||||
from click.testing import CliRunner
|
||||
|
||||
from osxphotos.cli.orphans import orphans
|
||||
|
||||
from .test_cli import PHOTOS_DB_15_7
|
||||
|
||||
|
||||
def test_orphans():
|
||||
"""test basic orphans"""
|
||||
runner = CliRunner()
|
||||
cwd = os.getcwd()
|
||||
# pylint: disable=not-context-manager
|
||||
with runner.isolated_filesystem():
|
||||
result = runner.invoke(
|
||||
orphans, ["--db", os.path.join(cwd, PHOTOS_DB_15_7), "-V"]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "Found 1 orphan" in result.output
|
||||
|
||||
|
||||
def test_orphans_export():
|
||||
"""test export of orphans"""
|
||||
runner = CliRunner()
|
||||
cwd = os.getcwd()
|
||||
# pylint: disable=not-context-manager
|
||||
with runner.isolated_filesystem():
|
||||
result = runner.invoke(
|
||||
orphans, ["--db", os.path.join(cwd, PHOTOS_DB_15_7), "--export", ".", "-V"]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "Exported 1 file" in result.output
|
||||
Reference in New Issue
Block a user