From b0ec6c6b36d8cfe05723d47b210d9d7c5aabdfe5 Mon Sep 17 00:00:00 2001 From: britiscurious Date: Fri, 8 May 2020 23:29:18 +0200 Subject: [PATCH] added test for export using hardlinks, fixed a test that failed if users locale settings were different to en_US --- tests/test_cli.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index b106855a..da3b592a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -241,6 +241,23 @@ def test_export(): assert sorted(files) == sorted(CLI_EXPORT_FILENAMES) +def test_export_using_hardlinks(): + import glob + import os + import os.path + import osxphotos + from osxphotos.__main__ import export + + runner = CliRunner() + cwd = os.getcwd() + # pylint: disable=not-context-manager + with runner.isolated_filesystem(): + result = runner.invoke(export, [os.path.join(cwd, CLI_PHOTOS_DB), ".", "--export-as-hardlink","-V"]) + assert result.exit_code == 0 + files = glob.glob("*") + assert sorted(files) == sorted(CLI_EXPORT_FILENAMES) + + def test_export_current_name(): import glob import os @@ -473,11 +490,14 @@ def test_export_raw_edited_original(): def test_export_directory_template_1(): # test export using directory template import glob + import locale import os import os.path import osxphotos from osxphotos.__main__ import export + locale.setlocale(locale.LC_ALL, "en_US") + runner = CliRunner() cwd = os.getcwd() # pylint: disable=not-context-manager