Code review comment for lp:~adam-collard/charms/precise/landscape-client/upgrade-charm-hook

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

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.

review: Approve

« Back to merge proposal