summaryrefslogtreecommitdiffstats
path: root/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py')
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py27
1 files changed, 12 insertions, 15 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py
index b63d08524..92dc85fb1 100644
--- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py
+++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py
@@ -295,8 +295,8 @@ class TestXMLPropertyFile(TestPropertyFile, TestStructFile):
self.assertFalse(mock_copy.called)
-class TestPropDirectoryBacked(TestDirectoryBacked):
- test_obj = PropDirectoryBacked
+class TestProperties(TestPlugin, TestConnector, TestDirectoryBacked):
+ test_obj = Properties
testfiles = ['foo.xml', 'bar.baz.xml']
if HAS_JSON:
testfiles.extend(["foo.json", "foo.xml.json"])
@@ -305,16 +305,13 @@ class TestPropDirectoryBacked(TestDirectoryBacked):
ignore = ['foo.xsd', 'bar.baz.xsd', 'quux.xml.xsd']
badevents = ['bogus.txt']
-
-class TestProperties(TestPlugin, TestConnector):
- test_obj = Properties
-
- def test__init(self):
- TestPlugin.test__init(self)
-
- core = Mock()
- p = self.get_obj(core=core)
- self.assertIsInstance(p.store, PropDirectoryBacked)
+ def get_obj(self, core=None):
+ @patch("%s.%s.add_directory_monitor" % (self.test_obj.__module__,
+ self.test_obj.__name__),
+ Mock())
+ def inner():
+ return TestPlugin.get_obj(self, core=core)
+ return inner()
@patch("copy.copy")
def test_get_additional_data(self, mock_copy):
@@ -322,11 +319,11 @@ class TestProperties(TestPlugin, TestConnector):
p = self.get_obj()
metadata = Mock()
- p.store.entries = {"foo.xml": Mock(),
- "foo.yml": Mock()}
+ p.entries = {"foo.xml": Mock(),
+ "foo.yml": Mock()}
rv = p.get_additional_data(metadata)
expected = dict()
- for name, entry in p.store.entries.items():
+ for name, entry in p.entries.items():
entry.get_additional_data.assert_called_with(metadata)
expected[name] = entry.get_additional_data.return_value
self.assertItemsEqual(rv, expected)