mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 10:25:28 +00:00
Add basic test for Utils.check_output()
This commit is contained in:
parent
83f2521d5e
commit
0bb66af883
1 changed files with 8 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ TESTS_BASEDIR = os.path.dirname(os.path.abspath(__file__))
|
|||
sys.path.insert(1, os.path.join(TESTS_BASEDIR, "..", "library"))
|
||||
|
||||
import network_connections as n
|
||||
from network_connections import SysUtil
|
||||
from network_connections import SysUtil, Util
|
||||
|
||||
|
||||
try:
|
||||
|
|
@ -1880,6 +1880,13 @@ class TestNM(unittest.TestCase):
|
|||
self.assertIsNotNone(connections)
|
||||
|
||||
|
||||
class TestUtils(unittest.TestCase):
|
||||
def test_check_output(self):
|
||||
res = Util.check_output(["echo", "test"])
|
||||
self.assertEqual(res, "test\n")
|
||||
self.assertRaises(n.MyError, Util.check_output, ["false"])
|
||||
|
||||
|
||||
class TestSysUtils(unittest.TestCase):
|
||||
def test_link_read_permaddress(self):
|
||||
# Manipulate PATH to use ethtool mock script to avoid hard dependency on
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue