~go-bot/juju-core/trunk

« back to all changes in this revision

Viewing changes to state/apiserver/uniter/uniter_test.go

  • Committer: Tarmac
  • Author(s): William Reade
  • Date: 2014-05-22 11:37:17 UTC
  • mfrom: (1679.1.11 juju-core)
  • Revision ID: tarmac-20140522113717-99dhnikcznpjpwrw
[r=fwereade],[bug=1192433] state: set departed on dying units' relations

This ended up including:

  * stopping using magic strings in cleanup
  * drawing a clear distinction between "joined" and "in scope" (which
    accounts for most of the lines of changes)

...but did *not* include:

  * fixing the name of the Uniter.JoinedRelations API, because I want to
    wait for API versioning

https://codereview.appspot.com/94540043/

Show diffs side-by-side

added added

removed removed

Lines of Context:
1065
1065
                        {rel.Tag()},
1066
1066
                },
1067
1067
        }
1068
 
        result, err := s.uniter.JoinedRelations(args)
1069
 
        c.Assert(err, gc.IsNil)
1070
 
        c.Assert(result, gc.DeepEquals, params.StringsResults{
 
1068
        expect := params.StringsResults{
1071
1069
                Results: []params.StringsResult{
1072
1070
                        {Result: []string{rel.Tag()}},
1073
1071
                        {Error: apiservertesting.ErrUnauthorized},
1076
1074
                        {Error: apiservertesting.ErrUnauthorized},
1077
1075
                        {Error: apiservertesting.ErrUnauthorized},
1078
1076
                },
1079
 
        })
 
1077
        }
 
1078
        check := func() {
 
1079
                result, err := s.uniter.JoinedRelations(args)
 
1080
                c.Assert(err, gc.IsNil)
 
1081
                c.Assert(result, gc.DeepEquals, expect)
 
1082
        }
 
1083
        check()
 
1084
        err = relUnit.PrepareLeaveScope()
 
1085
        c.Assert(err, gc.IsNil)
 
1086
        check()
1080
1087
}
1081
1088
 
1082
1089
func (s *uniterSuite) TestReadSettings(c *gc.C) {