ut: cli - test_import_comps
This commit is contained in:
parent
434bfb86f4
commit
86822c6399
12 changed files with 44800 additions and 0 deletions
15
tests/test_cli/loadcli.py
Normal file
15
tests/test_cli/loadcli.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
# We have to do this craziness because 'import koji' is ambiguous. Is it the
|
||||
# koji module, or the koji cli module. Jump through hoops accordingly.
|
||||
# http://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path
|
||||
CLI_FILENAME = os.path.dirname(__file__) + "/../../cli/koji"
|
||||
if sys.version_info[0] >= 3:
|
||||
import importlib.util
|
||||
spec = importlib.util.spec_from_file_location("koji_cli", CLI_FILENAME)
|
||||
cli = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(cli)
|
||||
else:
|
||||
import imp
|
||||
cli = imp.load_source('koji_cli', CLI_FILENAME)
|
||||
Loading…
Add table
Add a link
Reference in a new issue