github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/worker/uniter/runner/debug/common_test.go (about) 1 // Copyright 2013 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package debug_test 5 6 import ( 7 gc "gopkg.in/check.v1" 8 9 "github.com/juju/juju/worker/uniter/runner/debug" 10 ) 11 12 type DebugHooksCommonSuite struct{} 13 14 var _ = gc.Suite(&DebugHooksCommonSuite{}) 15 16 // TestHooksContext tests the behaviour of HooksContext. 17 func (*DebugHooksCommonSuite) TestHooksContext(c *gc.C) { 18 ctx := debug.NewHooksContext("foo/8") 19 c.Assert(ctx.Unit, gc.Equals, "foo/8") 20 c.Assert(ctx.FlockDir, gc.Equals, "/tmp") 21 ctx.FlockDir = "/var/lib/juju" 22 c.Assert(ctx.ClientFileLock(), gc.Equals, "/var/lib/juju/juju-unit-foo-8-debug-hooks") 23 c.Assert(ctx.ClientExitFileLock(), gc.Equals, "/var/lib/juju/juju-unit-foo-8-debug-hooks-exit") 24 }