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

Unified Diff: state/machine_test.go

Issue 7327050: state: Machine.InstanceId returns bool
Patch Set: state: Machine.InstanceId returns bool Created 12 years, 1 month ago
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « state/machine.go ('k') | state/state_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: state/machine_test.go
=== modified file 'state/machine_test.go'
--- state/machine_test.go 2013-02-10 10:15:07 +0000
+++ state/machine_test.go 2013-02-18 16:33:11 +0000
@@ -172,15 +172,14 @@
err = machine.Refresh()
c.Assert(err, IsNil)
- iid, err := machine.InstanceId()
- c.Assert(state.IsNotFound(err), Equals, true)
+ iid, ok := machine.InstanceId()
+ c.Assert(ok, Equals, false)
c.Assert(iid, Equals, state.InstanceId(""))
}
func (s *MachineSuite) TestMachineInstanceIdMissing(c *C) {
- iid, err := s.machine.InstanceId()
- c.Assert(state.IsNotFound(err), Equals, true)
- c.Assert(err, ErrorMatches, "instance id for machine 0 not found")
+ iid, ok := s.machine.InstanceId()
+ c.Assert(ok, Equals, false)
c.Assert(string(iid), Equals, "")
}
@@ -195,8 +194,8 @@
err = machine.Refresh()
c.Assert(err, IsNil)
- iid, err := machine.InstanceId()
- c.Assert(state.IsNotFound(err), Equals, true)
+ iid, ok := machine.InstanceId()
+ c.Assert(ok, Equals, false)
c.Assert(string(iid), Equals, "")
}
@@ -206,8 +205,8 @@
m, err := s.State.Machine(s.machine.Id())
c.Assert(err, IsNil)
- id, err := m.InstanceId()
- c.Assert(err, IsNil)
+ id, ok := m.InstanceId()
+ c.Assert(ok, Equals, true)
c.Assert(string(id), Equals, "umbrella/0")
}
« no previous file with comments | « state/machine.go ('k') | state/state_test.go » ('j') | no next file with comments »

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