summaryrefslogtreecommitdiffstats
path: root/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestHardlink.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestHardlink.py')
-rw-r--r--testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestHardlink.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestHardlink.py b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestHardlink.py
index 2f1b0c920..663c98af2 100644
--- a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestHardlink.py
+++ b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestHardlink.py
@@ -5,20 +5,18 @@ import lxml.etree
from mock import Mock, MagicMock, patch
from Bcfg2.Client.Tools.POSIX.Hardlink import *
from Test__init import get_posix_object
+from Testbase import TestPOSIXTool
from .....common import *
-def get_hardlink_object(posix=None):
- if posix is None:
- posix = get_posix_object()
- return POSIXHardlink(posix.logger, posix.setup, posix.config)
+class TestPOSIXHardlink(TestPOSIXTool):
+ test_obj = POSIXHardlink
-class TestPOSIXHardlink(Bcfg2TestCase):
@patch("os.path.samefile")
@patch("Bcfg2.Client.Tools.POSIX.base.POSIXTool.verify")
def test_verify(self, mock_verify, mock_samefile):
entry = lxml.etree.Element("Path", name="/test", type="hardlink",
to="/dest")
- ptool = get_hardlink_object()
+ ptool = self.get_obj()
mock_samefile.return_value = True
mock_verify.return_value = False
@@ -52,11 +50,11 @@ class TestPOSIXHardlink(Bcfg2TestCase):
@patch("os.link")
@patch("Bcfg2.Client.Tools.POSIX.base.POSIXTool.install")
- @patch("Bcfg2.Client.Tools.POSIX.Hardlink.POSIXHardlink._exists")
+ @patch("Bcfg2.Client.Tools.POSIX.Hardlink.%s._exists" % test_obj.__name__)
def test_install(self, mock_exists, mock_install, mock_link):
entry = lxml.etree.Element("Path", name="/test", type="hardlink",
to="/dest")
- ptool = get_hardlink_object()
+ ptool = self.get_obj()
mock_exists.return_value = False
mock_install.return_value = True