1
0
mirror of https://github.com/minio/mc.git synced 2025-11-14 23:42:27 +03:00

Fix a config corruption bug when config.json has wrong json format, would lead to overwriting the previous config.json

This commit is contained in:
Harshavardhana
2015-07-29 23:11:08 -07:00
parent 4175ca310c
commit 88bef1c60a
4 changed files with 34 additions and 38 deletions

View File

@@ -99,15 +99,15 @@ func (s *CmdTestSuite) TearDownSuite(c *C) {
}
func (s *CmdTestSuite) TestGetNewClient(c *C) {
_, err := getNewClient("http://example.com/bucket1", &hostConfig{})
_, err := getNewClient("http://example.com/bucket1", hostConfig{})
c.Assert(err, IsNil)
_, err = getNewClient("https://example.com/bucket1", &hostConfig{})
_, err = getNewClient("https://example.com/bucket1", hostConfig{})
c.Assert(err, IsNil)
_, err = getNewClient("C:\\Users\\Administrator\\MyDocuments", &hostConfig{})
_, err = getNewClient("C:\\Users\\Administrator\\MyDocuments", hostConfig{})
c.Assert(err, IsNil)
_, err = getNewClient("/usr/bin/pandoc", &hostConfig{})
_, err = getNewClient("/usr/bin/pandoc", hostConfig{})
c.Assert(err, IsNil)
_, err = getNewClient("pkg/client", &hostConfig{})
_, err = getNewClient("pkg/client", hostConfig{})
c.Assert(err, IsNil)
}