Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Side by Side Diff: state/apiserver/server_test.go

Issue 10026044: state/api: Split client Machiner into subpackage (Closed)
Patch Set: state/api: Split client Machiner into subpackage Created 11 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « state/apiserver/login_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package apiserver_test 4 package apiserver_test
5 5
6 import ( 6 import (
7 "io" 7 "io"
8 . "launchpad.net/gocheck" 8 . "launchpad.net/gocheck"
9 "launchpad.net/juju-core/rpc" 9 "launchpad.net/juju-core/rpc"
10 "launchpad.net/juju-core/state" 10 "launchpad.net/juju-core/state"
(...skipping 25 matching lines...) Expand all
36 // s.APIConn. 36 // s.APIConn.
37 st, err := api.Open(&api.Info{ 37 st, err := api.Open(&api.Info{
38 Tag: stm.Tag(), 38 Tag: stm.Tag(),
39 Password: "password", 39 Password: "password",
40 Addrs: []string{srv.Addr()}, 40 Addrs: []string{srv.Addr()},
41 CACert: []byte(coretesting.CACert), 41 CACert: []byte(coretesting.CACert),
42 }) 42 })
43 c.Assert(err, IsNil) 43 c.Assert(err, IsNil)
44 defer st.Close() 44 defer st.Close()
45 45
46 » _, err = st.Machiner("") 46 » _, err = st.Machiner()
47 c.Assert(err, IsNil) 47 c.Assert(err, IsNil)
48 48
49 err = srv.Stop() 49 err = srv.Stop()
50 c.Assert(err, IsNil) 50 c.Assert(err, IsNil)
51 51
52 » _, err = st.Machiner("") 52 » _, err = st.Machiner()
53 // The client has not necessarily seen the server shutdown yet, 53 // The client has not necessarily seen the server shutdown yet,
54 // so there are two possible errors. 54 // so there are two possible errors.
55 if err != rpc.ErrShutdown && err != io.ErrUnexpectedEOF { 55 if err != rpc.ErrShutdown && err != io.ErrUnexpectedEOF {
56 c.Fatalf("unexpected error from request: %v", err) 56 c.Fatalf("unexpected error from request: %v", err)
57 } 57 }
58 58
59 // Check it can be stopped twice. 59 // Check it can be stopped twice.
60 err = srv.Stop() 60 err = srv.Stop()
61 c.Assert(err, IsNil) 61 c.Assert(err, IsNil)
62 } 62 }
OLDNEW
« no previous file with comments | « state/apiserver/login_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b