summaryrefslogtreecommitdiffstats
path: root/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestSymlink.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestSymlink.py')
-rw-r--r--testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestSymlink.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestSymlink.py b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestSymlink.py
index d9a2717dd..03504ca61 100644
--- a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestSymlink.py
+++ b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestSymlink.py
@@ -5,20 +5,18 @@ import lxml.etree
from mock import Mock, MagicMock, patch
from Bcfg2.Client.Tools.POSIX.Symlink import *
from Test__init import get_posix_object
+from Testbase import TestPOSIXTool
from .....common import *
-def get_symlink_object(posix=None):
- if posix is None:
- posix = get_posix_object()
- return POSIXSymlink(posix.logger, posix.setup, posix.config)
+class TestPOSIXSymlink(TestPOSIXTool):
+ test_obj = POSIXSymlink
-class TestPOSIXSymlink(Bcfg2TestCase):
@patch("os.readlink")
@patch("Bcfg2.Client.Tools.POSIX.base.POSIXTool.verify")
def test_verify(self, mock_verify, mock_readlink):
entry = lxml.etree.Element("Path", name="/test", type="symlink",
to="/dest")
- ptool = get_symlink_object()
+ ptool = self.get_obj()
mock_readlink.return_value = entry.get("to")
mock_verify.return_value = False
@@ -48,11 +46,11 @@ class TestPOSIXSymlink(Bcfg2TestCase):
@patch("os.symlink")
@patch("Bcfg2.Client.Tools.POSIX.base.POSIXTool.install")
- @patch("Bcfg2.Client.Tools.POSIX.Symlink.POSIXSymlink._exists")
+ @patch("Bcfg2.Client.Tools.POSIX.Symlink.%s._exists" % test_obj.__name__)
def test_install(self, mock_exists, mock_install, mock_symlink):
entry = lxml.etree.Element("Path", name="/test", type="symlink",
to="/dest")
- ptool = get_symlink_object()
+ ptool = self.get_obj()
mock_exists.return_value = False
mock_install.return_value = True