Looks good! I think [8] needs fixing, but I'll mark this approved because I don't want to delay you once you've fixed it.
[8]
+ ppc64el_module.tempdir = tempdir
Use self.patch() here too; I think this will leak otherwise.
[9]
+ tmp = tempfile.mkdtemp('', 'maas-test-') + dest = tempfile.mkdtemp('', 'maas-test-') ... + rmtree(tmp) + rmtree(dest)
Fwiw, the call to rmtree should be put into a clean-up as soon as the directory is created, so that a test failure doesn't leave detritus around. For example:
tmp = tempfile.mkdtemp('', 'maas-test-') self.addCleanup(rmtree, tmp)
However, look at MAASTestCase.make_dir(). This does what you need.
« Back to merge proposal
Looks good! I think [8] needs fixing, but I'll mark this approved
because I don't want to delay you once you've fixed it.
[8]
+ ppc64el_ module. tempdir = tempdir
Use self.patch() here too; I think this will leak otherwise.
[9]
+ tmp = tempfile. mkdtemp( '', 'maas-test-') mkdtemp( '', 'maas-test-')
+ dest = tempfile.
...
+ rmtree(tmp)
+ rmtree(dest)
Fwiw, the call to rmtree should be put into a clean-up as soon as the
directory is created, so that a test failure doesn't leave detritus
around. For example:
tmp = tempfile. mkdtemp( '', 'maas-test-')
self.addCleanu p(rmtree, tmp)
However, look at MAASTestCase. make_dir( ). This does what you need.