fix remaining issues with checker.Not

Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Tibor Vass 2019-08-16 23:36:18 +00:00
parent ac2f24e72a
commit 40f1950e8e
3 changed files with 7 additions and 9 deletions

View file

@ -38,8 +38,7 @@ func pruneNetworkAndVerify(c *testing.T, d *daemon.Daemon, kept, pruned []string
out, err := d.Cmd("network", "ls", "--format", "{{.Name}}")
assert.NilError(c, err)
return out, ""
}, checker.Not(checker.Contains(s))()), poll.WithTimeout(defaultReconciliationTimeout))
}, checker.Not(checker.Contains(s))), poll.WithTimeout(defaultReconciliationTimeout))
}
}

View file

@ -389,7 +389,7 @@ func (s *DockerSwarmSuite) TestSwarmContainerAttachByNetworkId(c *testing.T) {
return out, ""
}
poll.WaitOn(c, pollCheck(c, checkNetwork, checker.Not(checker.Contains("testnet"))()), poll.WithTimeout(3*time.Second))
poll.WaitOn(c, pollCheck(c, checkNetwork, checker.Not(checker.Contains("testnet"))), poll.WithTimeout(3*time.Second))
}
func (s *DockerSwarmSuite) TestOverlayAttachable(c *testing.T) {

View file

@ -3,7 +3,6 @@ package discovery // import "github.com/docker/docker/pkg/discovery"
import (
"testing"
"github.com/docker/docker/integration-cli/checker"
"gotest.tools/assert"
)
@ -86,20 +85,20 @@ func (s *DiscoverySuite) TestEntriesEquality(c *testing.T) {
assert.Assert(c, entries.Equals(Entries{
&Entry{Host: "127.0.0.1", Port: "2375"},
&Entry{Host: "127.0.0.2", Port: "2375"},
}), checker.Equals, true)
}))
// Different size
assert.Assert(c, entries.Equals(Entries{
assert.Assert(c, !entries.Equals(Entries{
&Entry{Host: "127.0.0.1", Port: "2375"},
&Entry{Host: "127.0.0.2", Port: "2375"},
&Entry{Host: "127.0.0.3", Port: "2375"},
}), checker.Equals, false)
}))
// Different content
assert.Assert(c, entries.Equals(Entries{
assert.Assert(c, !entries.Equals(Entries{
&Entry{Host: "127.0.0.1", Port: "2375"},
&Entry{Host: "127.0.0.42", Port: "2375"},
}), checker.Equals, false)
}))
}