Improve config file platform test

main
Miloš Komarčević 4 years ago committed by Miloš Komarčević
parent 82adcb1f86
commit 23c5100f98

@ -1326,7 +1326,7 @@ standards-defined metadata.
With [--Modify cmd](#Modify_cmd), quotation marks are use to surround the With [--Modify cmd](#Modify_cmd), quotation marks are use to surround the
*cmd*. The Windows command line requires double quotes to be *cmd*. The Windows command line requires double quotes to be
used, however generally, quotes inside that string, can be either single used, however generally, quotes inside that string, can be either single
or double. Generally, UNIX based systems can use pairs of single or or double. Generally, Unix-based systems can use pairs of single or
double quotes in any position. In both systems, inner string quotation double quotes in any position. In both systems, inner string quotation
marks may need to use the `\` escape sequence. marks may need to use the `\` escape sequence.
@ -1634,11 +1634,11 @@ For another example, see: https://www.exiv2.org/sample.html
# 12 CONFIGURATION FILE # 12 CONFIGURATION FILE
**exiv2** can read an optional configuration file, which allows **exiv2** can read an optional configuration file, which allows
additional lens definitions to be added to translated output. On UNIX additional lens definitions to be added to translated output. On Unix-based
based systems, this file is called *.exiv2* and on Windows (including MinGW), systems (including Cygwin), this file is called *.exiv2* and on Windows
*exiv2.ini*. The file is searched for first in the current directory, (including MinGW), *exiv2.ini*. The file is searched for first in the
then in the home directory (on UNIX based systems, `~/` and on Windows, current directory, then in the home directory (`$HOME` on Unix-based
`%USERPROFILE%\\`). systems, and `%USERPROFILE%` on Windows).
You can determine the name of the file and where it is searched for, You can determine the name of the file and where it is searched for,
with the command: with the command:

@ -6,11 +6,11 @@ import sys
# copy the example config file into current working directory # copy the example config file into current working directory
# and name it ".exiv2" on linux or "exiv2.ini" on Win # and name it "exiv2.ini" on Win or ".exiv2" on other platforms
class TmpConfigFile(system_tests.FileDecoratorBase): class TmpConfigFile(system_tests.FileDecoratorBase):
def setUp_file_action(self, expanded_file_name): def setUp_file_action(self, expanded_file_name):
config_file_path = os.path.dirname(os.path.abspath(__file__)) config_file_path = os.path.dirname(os.path.abspath(__file__))
fname = ".exiv2" if sys.platform == "linux" or sys.platform == "darwin" else "exiv2.ini" fname = os.path.basename(system_tests.BT.verbose_version().get('config_path'))
return shutil.copyfile(expanded_file_name, os.path.join(config_file_path, fname)) return shutil.copyfile(expanded_file_name, os.path.join(config_file_path, fname))

Loading…
Cancel
Save