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

Unified Diff: state/initialize_test.go

Issue 12551043: state: implement the single FindEntity method
Patch Set: state: implement the single FindEntity method Created 10 years, 7 months 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
Index: state/initialize_test.go
=== modified file 'state/initialize_test.go'
--- state/initialize_test.go 2013-07-09 10:32:23 +0000
+++ state/initialize_test.go 2013-08-06 16:04:10 +0000
@@ -49,7 +49,7 @@
func (s *InitializeSuite) TestInitialize(c *C) {
_, err := s.State.EnvironConfig()
c.Assert(err, checkers.Satisfies, errors.IsNotFoundError)
- _, err = s.State.Annotator("environment-foo")
+ _, err = s.State.FindEntity("environment-foo")
c.Assert(err, checkers.Satisfies, errors.IsNotFoundError)
_, err = s.State.EnvironConstraints()
c.Assert(err, checkers.Satisfies, errors.IsNotFoundError)
@@ -65,8 +65,9 @@
cfg, err = s.State.EnvironConfig()
c.Assert(err, IsNil)
c.Assert(cfg.AllAttrs(), DeepEquals, initial)
- env, err := s.State.Annotator("environment-" + cfg.Name())
+ env0, err := s.State.FindEntity("environment-" + cfg.Name())
c.Assert(err, IsNil)
+ env := env0.(state.Annotator)
annotations, err := env.Annotations()
c.Assert(err, IsNil)
c.Assert(annotations, HasLen, 0)
« state/apiserver/common/errors.go ('K') | « state/assign_test.go ('k') | state/interface.go » ('j') | no next file with comments »

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