-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Check for required programs at wahooMapsCreator start (#127)
* implement check for required programs for macOS - incl. unittests * move get_tooling_win_path to constants_functions * implement check for required programs for Windows - incl. unittests * adjustments after testing on Windows. Extension needed * verbose output for osmium processing * catch error if no file exists in plugins directory * format terminal output when checking for required programs * move get_tag_wahoo_xml_path to constants_functions to be identical with changes from eab0345 * Revert "verbose output for osmium processing" This reverts commit a700f68. It is not working as intended on macOS // not outputting something. Most likely because of the "subprocess.Popen" stlye of calling the command * Bump to version v2.1.0a15
- Loading branch information
Showing
8 changed files
with
198 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
""" | ||
tests for setup functions | ||
""" | ||
import unittest | ||
import platform | ||
import os | ||
|
||
# import custom python packages | ||
from wahoomc.setup_functions import is_program_installed, is_map_writer_plugin_installed | ||
from wahoomc.constants_functions import get_tooling_win_path | ||
|
||
|
||
class TestSetup(unittest.TestCase): | ||
""" | ||
tests for the required non-python programs of the python module | ||
""" | ||
|
||
def test_installed_programs_mac(self): | ||
""" | ||
tests, if the mac-relevant programs are installed | ||
""" | ||
if platform.system() != "Windows": | ||
self.check_installation_of_program("java") | ||
|
||
self.check_installation_of_program("osmium") | ||
self.check_installation_of_program("osmosis") | ||
|
||
result = is_map_writer_plugin_installed() | ||
self.assertTrue(result) | ||
|
||
def test_installed_programs_windows(self): | ||
""" | ||
tests, if the mac-relevant programs are installed | ||
""" | ||
if platform.system() == "Windows": | ||
self.check_installation_of_program("java") | ||
|
||
self.assertTrue(os.path.exists(get_tooling_win_path( | ||
['Osmosis', 'bin', 'osmosis.bat']))) | ||
self.assertTrue(os.path.exists( | ||
get_tooling_win_path(['osmconvert.exe']))) | ||
self.assertTrue(os.path.exists( | ||
get_tooling_win_path(['osmfilter.exe']))) | ||
self.assertTrue(os.path.exists(get_tooling_win_path(['7za.exe']))) | ||
|
||
def check_installation_of_program(self, program): | ||
""" | ||
tests, if a given program is installed | ||
""" | ||
|
||
result = is_program_installed(program) | ||
|
||
self.assertTrue(result) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters