~themue/juju-core/050-prepare-openstack

« back to all changes in this revision

Viewing changes to state/unit_test.go

  • Committer: Dimiter Naydenov
  • Date: 2013-07-29 15:15:41 UTC
  • mto: This revision was merged to the branch mainline in revision 1565.
  • Revision ID: dimiter.naydenov@canonical.com-20130729151541-zm8murwo9u7mtsdu
names: new package

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        c.Assert(err, checkers.Satisfies, errors.IsNotFoundError)
45
45
}
46
46
 
47
 
func (s *UnitSuite) TestUnitNameFromTag(c *C) {
48
 
        // Try both valid and invalid tag formats.
49
 
        c.Assert(state.UnitNameFromTag("unit-wordpress-0"), Equals, "wordpress/0")
50
 
        c.Assert(state.UnitNameFromTag("foo"), Equals, "")
51
 
}
52
 
 
53
47
func (s *UnitSuite) TestService(c *C) {
54
48
        svc, err := s.unit.Service()
55
49
        c.Assert(err, IsNil)
533
527
        c.Assert(s.unit.Tag(), Equals, "unit-wordpress-0")
534
528
}
535
529
 
536
 
func (s *UnitSuite) TestUnitTag(c *C) {
537
 
        c.Assert(state.UnitTag("wordpress/2"), Equals, "unit-wordpress-2")
538
 
}
539
 
 
540
530
func (s *UnitSuite) TestSetMongoPassword(c *C) {
541
531
        testSetMongoPassword(c, func(st *state.State) (entity, error) {
542
532
                return st.Unit(s.unit.Name())