Nice work, +1!
[3]
Would you mind creating a hooks/tests sub-directory and move test_hooks.py there? For consistency with client/server code, and to avoid cluttering the hooks dir (we should eventually have test_ceph.py, test_common.py etc).
[4]
+ class StubConfig(object): + + data_path = mkdtemp(prefix=self.__class__.__name__) + meta_data_path = os.path.join(data_path, "metadata.d") + + self.config = StubConfig() + self.addCleanup(rmtree, self.config.data_path)
What do you think of:
a) Using MockerTestCase, which sports the makeDir() method, saving boilerplate.
b) Using a real Configuration object, you just need to set the data_path attribute on it.
When possible it feels that using real objects is preferable, to eliminate the risk of interface mismatch with the stub.
« Back to merge proposal
Nice work, +1!
[3]
Would you mind creating a hooks/tests sub-directory and move test_hooks.py there? For consistency with client/server code, and to avoid cluttering the hooks dir (we should eventually have test_ceph.py, test_common.py etc).
[4]
+ class StubConfig(object): prefix= self.__ class__ .__name_ _) join(data_ path, "metadata.d") (rmtree, self.config. data_path)
+
+ data_path = mkdtemp(
+ meta_data_path = os.path.
+
+ self.config = StubConfig()
+ self.addCleanup
What do you think of:
a) Using MockerTestCase, which sports the makeDir() method, saving
boilerplate.
b) Using a real Configuration object, you just need to set the data_path
attribute on it.
When possible it feels that using real objects is preferable, to eliminate the risk of interface mismatch with the stub.