Merge lp:~thumper/juju-core/better-container-instance-tests into lp:~go-bot/juju-core/trunk
Proposed by
Tim Penhey
Status: | Merged |
---|---|
Approved by: | Tim Penhey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2055 |
Proposed branch: | lp:~thumper/juju-core/better-container-instance-tests |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
45 lines (+22/-6) 1 file modified
instance/container_test.go (+22/-6) |
To merge this branch: | bzr merge lp:~thumper/juju-core/better-container-instance-tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+194975@code.launchpad.net |
Commit message
instance container method tests
Be explicit in the container type equality.
Test the parsing of KVM.
Change the tests names to be consistent with the functions.
Description of the change
instance container method tests
Be explicit in the container type equality.
Test the parsing of KVM.
Change the tests names to be consistent with the functions.
To post a comment you must log in.
Reviewers: mp+194975_ code.launchpad. net,
Message:
Please take a look.
Description:
instance container method tests
Be explicit in the container type equality.
Test the parsing of KVM.
Change the tests names to be consistent with the functions.
https:/ /code.launchpad .net/~thumper/ juju-core/ better- container- instance- tests/+ merge/194975
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/25460045/
Affected files (+24, -6 lines): container_ test.go
A [revision details]
M instance/
Index: [revision details] 20131113015012- y3lnl9jzz40v7h6 v
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: instance/ container_ test.go container_ test.go' container_ test.go 2013-11-12 01:59:52 +0000 container_ test.go 2013-11-13 01:40:16 +0000
=== modified file 'instance/
--- instance/
+++ instance/
@@ -19,19 +19,35 @@
var _ = gc.Suite( &InstanceSuite{ })
-func (s *InstanceSuite) TestParseAllowe dContainerType( c *gc.C) { nerType( c *gc.C) { ParseContainerT ype("lxc" ) ContainerType( "lxc")) ParseContainerT ype("kvm" ) ParseContainerT ype("none" ) ParseContainerT ype("omg" )
+func (s *InstanceSuite) TestParseContai
ctype, err := instance.
c.Assert(err, gc.IsNil)
- c.Assert(ctype, gc.Equals, instance.
+ c.Assert(ctype, gc.Equals, instance.LXC)
+
+ ctype, err = instance.
+ c.Assert(err, gc.IsNil)
+ c.Assert(ctype, gc.Equals, instance.KVM)
+
ctype, err = instance.
- c.Assert(err, gc.Not(gc.IsNil))
+ c.Assert(err, gc.ErrorMatches, `invalid container type "none"`)
+
+ ctype, err = instance.
+ c.Assert(err, gc.ErrorMatches, `invalid container type "omg"`)
}
-func (s *InstanceSuite) TestParseAllowe dContainerTypeO rNone(c *gc.C) { nerTypeOrNone( c *gc.C) { ParseContainerT ypeOrNone( "lxc") ContainerType( "lxc")) ParseContainerT ypeOrNone( "kvm") ParseContainerT ypeOrNone( "none") ContainerType( "none") ) ParseSupportedC ontainerTypeOrN one("omg" )
+func (s *InstanceSuite) TestParseContai
ctype, err := instance.
c.Assert(err, gc.IsNil)
- c.Assert(ctype, gc.Equals, instance.
+ c.Assert(ctype, gc.Equals, instance.LXC)
+
+ ctype, err = instance.
+ c.Assert(err, gc.IsNil)
+ c.Assert(ctype, gc.Equals, instance.KVM)
+
ctype, err = instance.
c.Assert(err, gc.IsNil)
- c.Assert(ctype, gc.Equals, instance.
+ c.Assert(ctype, gc.Equals, instance.NONE)
+
+ ctype, err = instance.
+ c.Assert(err, gc.ErrorMatches, `invalid container type "omg"`)
}