Skip to content

Commit f6d1f69

Browse files
committed
Adds an import test that imports all CLI modules to catch syntax errors and expose it as missing test coverage
1 parent 8349f8e commit f6d1f69

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
SoftLayer.tests.CLI.modules.bmc_tests
3+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+
5+
This is a series of integration tests designed to test the complete
6+
command line interface.
7+
8+
:license: MIT, see LICENSE for more details.
9+
"""
10+
from SoftLayer.tests import unittest
11+
from SoftLayer.CLI.modules import get_module_list
12+
13+
from importlib import import_module
14+
15+
16+
class TestImportCLIModules(unittest.TestCase):
17+
18+
def test_import_all(self):
19+
modules = get_module_list()
20+
for module in modules:
21+
module_path = 'SoftLayer.CLI.modules.' + module
22+
23+
import_module(module_path)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
verbosity=2
33
detailed-errors=1
44
with-coverage=1
5-
cover-min-percentage = 100
5+
cover-min-percentage=68
66
cover-erase=true
77
cover-package=SoftLayer
88
cover-html=1

0 commit comments

Comments
 (0)