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

Delta Between Two Patch Sets: state/environcapability_test.go

Issue 77820044: Add EnvironCapability to state.Policy
Left Patch Set: Add EnvironCapability to state.Policy Created 10 years ago
Right Patch Set: Add EnvironCapability to state.Policy Created 9 years, 12 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « state/conn_test.go ('k') | state/policy.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 2014 Canonical Ltd. 1 // Copyright 2014 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 state_test 4 package state_test
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 8
9 gc "launchpad.net/gocheck" 9 gc "launchpad.net/gocheck"
10 10
11 "launchpad.net/juju-core/environs/config" 11 "launchpad.net/juju-core/environs/config"
12 "launchpad.net/juju-core/errors" 12 "launchpad.net/juju-core/errors"
13 "launchpad.net/juju-core/instance" 13 "launchpad.net/juju-core/instance"
14 "launchpad.net/juju-core/state" 14 "launchpad.net/juju-core/state"
15 ) 15 )
16 16
17 type EnvironCapabilitySuite struct { 17 type EnvironCapabilitySuite struct {
18 ConnSuite 18 ConnSuite
19 capability mockEnvironCapability 19 capability mockEnvironCapability
20 } 20 }
21 21
22 var _ = gc.Suite(&EnvironCapabilitySuite{}) 22 var _ = gc.Suite(&EnvironCapabilitySuite{})
23 23
24 type mockEnvironCapability struct { 24 type mockEnvironCapability struct {
25 supportsUnitPlacementError error 25 supportsUnitPlacementError error
26 } 26 }
27 27
28 func (p *mockEnvironCapability) SupportedArchitectures() ([]string, error) { 28 func (p *mockEnvironCapability) SupportedArchitectures() ([]string, error) {
29 panic("unused")
30 }
31
32 func (p *mockEnvironCapability) SupportNetworks() bool {
29 panic("unused") 33 panic("unused")
30 } 34 }
31 35
32 func (p *mockEnvironCapability) SupportsUnitPlacement() error { 36 func (p *mockEnvironCapability) SupportsUnitPlacement() error {
33 return p.supportsUnitPlacementError 37 return p.supportsUnitPlacementError
34 } 38 }
35 39
36 func (s *EnvironCapabilitySuite) SetUpTest(c *gc.C) { 40 func (s *EnvironCapabilitySuite) SetUpTest(c *gc.C) {
37 s.ConnSuite.SetUpTest(c) 41 s.ConnSuite.SetUpTest(c)
38 s.capability = mockEnvironCapability{} 42 s.capability = mockEnvironCapability{}
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 107
104 func (s *EnvironCapabilitySuite) TestSupportsUnitPlacementNoPolicy(c *gc.C) { 108 func (s *EnvironCapabilitySuite) TestSupportsUnitPlacementNoPolicy(c *gc.C) {
105 s.policy.getEnvironCapability = func(*config.Config) (state.EnvironCapab ility, error) { 109 s.policy.getEnvironCapability = func(*config.Config) (state.EnvironCapab ility, error) {
106 c.Errorf("should not have been invoked") 110 c.Errorf("should not have been invoked")
107 return nil, nil 111 return nil, nil
108 } 112 }
109 state.SetPolicy(s.State, nil) 113 state.SetPolicy(s.State, nil)
110 _, err := s.addOneMachine(c) 114 _, err := s.addOneMachine(c)
111 c.Assert(err, gc.IsNil) 115 c.Assert(err, gc.IsNil)
112 } 116 }
LEFTRIGHT

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