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

Fix test cases where cp and mirror would fail

- globalQuietFlag and globalJSONFlag should be checked in conjunction
  for terminal features to be disabled. Otherwise ioctl fails for
  calculating the term size.

- Avoid unnecessary scoping for probe, it has two different error sets now
This commit is contained in:
Harshavardhana
2015-08-12 22:11:29 -07:00
parent e2c4d25e86
commit 99f53fe45d
6 changed files with 65 additions and 54 deletions

View File

@@ -55,25 +55,18 @@ func (s *CmdTestSuite) TestCopyURLType(c *C) {
// TODO fix both copy and mirror
func (s *CmdTestSuite) TestCopyContext(c *C) {
err := app.Run([]string{os.Args[0], "cp", server.URL + "/bucket...", server.URL + "/bucket"})
err := app.Run([]string{os.Args[0], "cp", server.URL + "/invalid...", server.URL + "/bucket"})
c.Assert(err, IsNil)
c.Assert(console.IsExited, Equals, true)
err = app.Run([]string{os.Args[0], "cp", server.URL + "/invalid...", server.URL + "/bucket"})
c.Assert(err, IsNil)
c.Assert(console.IsExited, Equals, true)
c.Assert(console.IsError, Equals, true)
// reset back
console.IsExited = false
console.IsError = false
}
func (s *CmdTestSuite) TestMirrorContext(c *C) {
err := app.Run([]string{os.Args[0], "mirror", server.URL + "/bucket...", server.URL + "/bucket"})
err := app.Run([]string{os.Args[0], "mirror", server.URL + "/invalid...", server.URL + "/bucket"})
c.Assert(err, IsNil)
c.Assert(console.IsExited, Equals, true)
c.Assert(console.IsError, Equals, true)
err = app.Run([]string{os.Args[0], "mirror", server.URL + "/invalid...", server.URL + "/bucket"})
c.Assert(err, IsNil)
c.Assert(console.IsExited, Equals, true)
// reset back
console.IsExited = false
console.IsError = false
}