def test_save_value_changes_value(self): save_value('docker_user', '~/here') list_config_values() self.assertItemsEqual(json.loads(self.last_client_output.replace('\'', '\"').replace('False', 'false').replace('True', 'true')), {constants.CONFIG_BUNDLES_KEY: [], constants.CONFIG_REPO_OVERRIDES_KEY: {get_specs_repo(): self.temp_specs_path}, 'docker_user': '******', constants.CONFIG_SPECS_REPO_KEY: 'github.com/org/dusty-specs', constants.CONFIG_SETUP_KEY: False, constants.CONFIG_VM_MEM_SIZE: '2048'})
def test_save_value_changes_value(self): save_value('docker_user', '~/here') list_config_values() self.assertItemsEqual(json.loads(self.last_client_output.replace('\'', '\"').replace('False', 'false').replace('True', 'true')), {constants.CONFIG_BUNDLES_KEY: [], constants.CONFIG_ENV_KEY: {}, constants.CONFIG_REPO_OVERRIDES_KEY: {get_specs_repo(): self.temp_specs_path}, 'docker_user': '******', constants.CONFIG_SPECS_REPO_KEY: 'github.com/org/dusty-specs', constants.CONFIG_SETUP_KEY: False, constants.CONFIG_VM_MEM_SIZE: '2048'})
def test_save_value_no_changes(self): with self.assertRaises(KeyError): save_value(constants.CONFIG_BUNDLES_KEY, '~/here')