def default_write_test(self): conf = AnacondaConfiguration.from_defaults() with tempfile.NamedTemporaryFile("r+") as f: conf.write(f.name) f.flush() self.assertTrue(f.read(), "The file shouldn't be empty.")
def write_test(self): conf = AnacondaConfiguration() with tempfile.NamedTemporaryFile("r+") as f: conf.write(f.name) f.flush() self.assertFalse(f.read(), "The file should be empty.")
def write_test(self): conf = AnacondaConfiguration() with tempfile.NamedTemporaryFile("r+") as f: conf.write(f.name) f.flush() self.assertFalse(f.read(), "The file should be empty.")
def default_write_test(self): conf = AnacondaConfiguration.from_defaults() with tempfile.NamedTemporaryFile("r+") as f: conf.write(f.name) f.flush() self.assertTrue(f.read(), "The file shouldn't be empty.")
def _write_temporary_config(self): """Create the temporary config file.""" dirname = os.path.dirname(ANACONDA_CONFIG_TMP) if not os.path.exists(dirname): os.makedirs(dirname) log.info("Writing a temporary configuration loaded from: %s", conf.get_sources()) conf.write(ANACONDA_CONFIG_TMP)