def main(): try: tmp_dir = tmp.create_dir() LOG.debug('Created tmp directory %s', tmp_dir) virt_builder_args = _process_args(sys.argv[1:], tmp_dir) _run_virt_builder(virt_builder_args) finally: tmp.remove_dir(tmp_dir) LOG.debug('Removed tmp directory %s', tmp_dir)
def test_create_dir(self, mkdir, exists): tmp_dir = tmp.create_dir() mkdir.assert_called_with(tmp_dir, 0o700) self.assertThat(tmp_dir, matchers.MatchesRegex('^/tmp/rejviz-builder-\\d+$'))