From: radhika Date: Wed, 28 Oct 2015 16:21:21 +0000 (-0400) Subject: 7167: update keep-rsync tests to use "Contains" instead of "HasSuffix" to make sure... X-Git-Tag: 1.1.0~1282^2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/89c2982376a7275e873d203c949d13b40fbd3bc4 7167: update keep-rsync tests to use "Contains" instead of "HasSuffix" to make sure the error message checks pass even when retries happen. --- diff --git a/tools/keep-rsync/keep-rsync_test.go b/tools/keep-rsync/keep-rsync_test.go index 143e155227..e728890388 100644 --- a/tools/keep-rsync/keep-rsync_test.go +++ b/tools/keep-rsync/keep-rsync_test.go @@ -369,7 +369,7 @@ func (s *ServerRequiredSuite) TestErrorDuringRsync_ErrorPuttingBlockInDst(c *C) kcDst.Want_replicas = 2 err := performKeepRsync(kcSrc, kcDst, blobSigningKey, "") - c.Check(strings.HasSuffix(err.Error(), "Could not write sufficient replicas"), Equals, true) + c.Check(strings.Contains(err.Error(), "Could not write sufficient replicas"), Equals, true) } // Test loadConfig func @@ -413,7 +413,7 @@ func (s *ServerNotRequiredSuite) TestLoadConfig_MissingSrcConfig(c *C) { // Test loadConfig func - error reading config func (s *ServerNotRequiredSuite) TestLoadConfig_ErrorLoadingSrcConfig(c *C) { _, _, err := loadConfig("no-such-config-file") - c.Assert(strings.HasSuffix(err.Error(), "no such file or directory"), Equals, true) + c.Assert(strings.Contains(err.Error(), "no such file or directory"), Equals, true) } func setupConfigFile(c *C, name string) *os.File {