1
// Copyright 2013 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
9
"github.com/juju/juju/instance"
12
// MatchInstances uses DeepEquals to check the instances returned. The lists
13
// are first put into a map, so the ordering of the result and expected values
14
// is not tested, and duplicates are ignored.
15
func MatchInstances(c *gc.C, result []instance.Instance, expected ...instance.Instance) {
16
resultMap := make(map[instance.Id]instance.Instance)
17
for _, i := range result {
21
expectedMap := make(map[instance.Id]instance.Instance)
22
for _, i := range expected {
23
expectedMap[i.Id()] = i
25
c.Assert(resultMap, gc.DeepEquals, expectedMap)