@@ -103,82 +103,3 @@ func TestConfigDir_IbmCloudConfigHomeSet_Exists(t *testing.T) {
103
103
os .Setenv ("IBMCLOUD_CONFIG_HOME" , userHome )
104
104
assert .Equal (userHome , ConfigDir ())
105
105
}
106
-
107
- // func TestMigrateFromOldConfig(t *testing.T) {
108
- // assert := assert.New(t)
109
-
110
- // err := prepareBluemixHome()
111
- // assert.NoError(err)
112
- // defer clearBluemixHome()
113
-
114
- // err = os.MkdirAll(oldConfigDir(), 0700)
115
- // assert.NoError(err)
116
- // oldConfigPath := filepath.Join(oldConfigDir(), "config.json")
117
- // err = ioutil.WriteFile(oldConfigPath, []byte("old"), 0600)
118
- // assert.NoError(err)
119
-
120
- // err = MigrateFromOldConfig()
121
- // assert.NoError(err)
122
-
123
- // newConfigPath := filepath.Join(newConfigDir(), "config.json")
124
- // assert.True(file_helpers.FileExists(newConfigPath))
125
- // content, err := ioutil.ReadFile(newConfigPath)
126
- // assert.NoError(err)
127
- // assert.Equal([]byte("old"), content, "should copy old config file")
128
-
129
- // assert.False(file_helpers.FileExists(oldConfigDir()), "old config dir should be deleted")
130
- // }
131
-
132
- // func TestMigrateFromOldConfig_NewConfigExist(t *testing.T) {
133
- // assert := assert.New(t)
134
-
135
- // err := prepareBluemixHome()
136
- // assert.NoError(err)
137
- // defer clearBluemixHome()
138
-
139
- // err = os.MkdirAll(oldConfigDir(), 0700)
140
- // assert.NoError(err)
141
- // oldConfigPath := filepath.Join(oldConfigDir(), "config.json")
142
- // err = ioutil.WriteFile(oldConfigPath, []byte("old"), 0600)
143
- // assert.NoError(err)
144
-
145
- // err = os.MkdirAll(newConfigDir(), 0700)
146
- // assert.NoError(err)
147
- // newConfigPath := filepath.Join(newConfigDir(), "config.json")
148
- // err = ioutil.WriteFile(newConfigPath, []byte("new"), 0600)
149
- // assert.NoError(err)
150
-
151
- // err = MigrateFromOldConfig()
152
- // assert.NoError(err)
153
-
154
- // content, err := ioutil.ReadFile(newConfigPath)
155
- // assert.NoError(err)
156
- // assert.Equal([]byte("new"), content, "should not copy old config file")
157
- // }
158
-
159
- // func TestMigrateFromOldConfig_OldConfigNotExist(t *testing.T) {
160
- // assert := assert.New(t)
161
-
162
- // err := prepareBluemixHome()
163
- // assert.NoError(err)
164
- // defer clearBluemixHome()
165
-
166
- // err = MigrateFromOldConfig()
167
- // assert.NoError(err)
168
- // }
169
-
170
- // func prepareBluemixHome() error {
171
- // temp, err := ioutil.TempDir("", "IBMCloudSDKConfigTest")
172
- // if err != nil {
173
- // return err
174
- // }
175
- // os.Setenv("BLUEMIX_HOME", temp)
176
- // return nil
177
- // }
178
-
179
- // func clearBluemixHome() {
180
- // if homeDir := os.Getenv("BLUEMIX_HOME"); homeDir != "" {
181
- // os.RemoveAll(homeDir)
182
- // os.Unsetenv("BLUEMIX_HOME")
183
- // }
184
- // }
0 commit comments