def _write_new_config(self, profile): config_path = self._session.get_config_variable('config_file') config_path = os.path.expanduser(config_path) if self._new_values: section = profile_to_section(profile) self._new_values['__section__'] = section self._config_writer.update_config(self._new_values, config_path)
def test_default_profile(self): profile = 'default' section = profile_to_section(profile) self.assertEqual(profile, section)
def test_profile_with_consecutive_spaces(self): profile = ' ' section = profile_to_section(profile) self.assertEqual('profile \' \'', section)
def test_profile_with_tab(self): profile = 'tab\ts' section = profile_to_section(profile) self.assertEqual('profile \'tab\ts\'', section)
def test_profile_with_spaces(self): profile = 'my spaced profile' section = profile_to_section(profile) self.assertEqual('profile \'my spaced profile\'', section)
def test_normal_profile(self): profile = 'my-profile' section = profile_to_section(profile) self.assertEqual('profile my-profile', section)