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

Delta Between Two Patch Sets: state/api/machiner/machiner_test.go

Issue 78890043: state/api: implement APIHostPorts methods
Left Patch Set: Created 11 years ago
Right Patch Set: state/api: implement APIHostPorts methods Created 11 years 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « state/api/machiner/machiner.go ('k') | state/api/params/internal.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 machiner_test 4 package machiner_test
5 5
6 import ( 6 import (
7 stdtesting "testing" 7 stdtesting "testing"
8 8
9 jc "github.com/juju/testing/checkers" 9 jc "github.com/juju/testing/checkers"
10 gc "launchpad.net/gocheck" 10 gc "launchpad.net/gocheck"
(...skipping 23 matching lines...) Expand all
34 34
35 machiner *machiner.State 35 machiner *machiner.State
36 } 36 }
37 37
38 var _ = gc.Suite(&machinerSuite{}) 38 var _ = gc.Suite(&machinerSuite{})
39 39
40 func (s *machinerSuite) SetUpTest(c *gc.C) { 40 func (s *machinerSuite) SetUpTest(c *gc.C) {
41 s.JujuConnSuite.SetUpTest(c) 41 s.JujuConnSuite.SetUpTest(c)
42 m, err := s.State.AddMachine("quantal", state.JobManageEnviron) 42 m, err := s.State.AddMachine("quantal", state.JobManageEnviron)
43 c.Assert(err, gc.IsNil) 43 c.Assert(err, gc.IsNil)
44 » m.SetAddresses(instance.NewAddresses([]string{"127.0.0.1"})) 44 » err = m.SetAddresses(instance.NewAddresses([]string{"127.0.0.1"}))
45 » c.Assert(err, gc.IsNil)
45 46
46 s.st, s.machine = s.OpenAPIAsNewMachine(c) 47 s.st, s.machine = s.OpenAPIAsNewMachine(c)
47 // Create the machiner API facade. 48 // Create the machiner API facade.
48 s.machiner = s.st.Machiner() 49 s.machiner = s.st.Machiner()
49 c.Assert(s.machiner, gc.NotNil) 50 c.Assert(s.machiner, gc.NotNil)
50 » s.APIAddresserTests = apitesting.NewAPIAddresserTests(s.BackingState, s. machiner) 51 » s.APIAddresserTests = apitesting.NewAPIAddresserTests(s.machiner, s.Back ingState)
51 } 52 }
52 53
53 func (s *machinerSuite) TestMachineAndMachineTag(c *gc.C) { 54 func (s *machinerSuite) TestMachineAndMachineTag(c *gc.C) {
54 machine, err := s.machiner.Machine("machine-42") 55 machine, err := s.machiner.Machine("machine-42")
55 c.Assert(err, gc.ErrorMatches, "permission denied") 56 c.Assert(err, gc.ErrorMatches, "permission denied")
56 c.Assert(err, jc.Satisfies, params.IsCodeUnauthorized) 57 c.Assert(err, jc.Satisfies, params.IsCodeUnauthorized)
57 c.Assert(machine, gc.IsNil) 58 c.Assert(machine, gc.IsNil)
58 59
59 machine, err = s.machiner.Machine("machine-1") 60 machine, err = s.machiner.Machine("machine-1")
60 c.Assert(err, gc.IsNil) 61 c.Assert(err, gc.IsNil)
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 wc.AssertNoChange() 164 wc.AssertNoChange()
164 165
165 // Make the machine dead and check it's detected. 166 // Make the machine dead and check it's detected.
166 err = machine.EnsureDead() 167 err = machine.EnsureDead()
167 c.Assert(err, gc.IsNil) 168 c.Assert(err, gc.IsNil)
168 wc.AssertOneChange() 169 wc.AssertOneChange()
169 170
170 statetesting.AssertStop(c, w) 171 statetesting.AssertStop(c, w)
171 wc.AssertClosed() 172 wc.AssertClosed()
172 } 173 }
LEFTRIGHT

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