6
6
gc "launchpad.net/gocheck"
8
"launchpad.net/juju-core/juju/osenv"
8
"launchpad.net/juju-core/utils"
11
func (s *importSuite) TestHome(c *gc.C) {
11
type homeSuite struct {
15
var _ = gc.Suite(&homeSuite{})
17
func (s *homeSuite) TestHome(c *gc.C) {
12
18
s.PatchEnvironment("HOMEPATH", "")
13
19
s.PatchEnvironment("HOMEDRIVE", "")
16
22
path := `\home\foo\bar`
19
25
c.Check(os.Getenv("HOMEPATH"), gc.Equals, path)
20
26
c.Check(os.Getenv("HOMEDRIVE"), gc.Equals, drive)
21
c.Check(osenv.Home(), gc.Equals, h)
27
c.Check(utils.Home(), gc.Equals, h)
23
29
// now test that if we only set the path, we don't mess with the drive
25
31
path2 := `\home\someotherfoo\bar`
29
35
c.Check(os.Getenv("HOMEPATH"), gc.Equals, path2)
30
36
c.Check(os.Getenv("HOMEDRIVE"), gc.Equals, drive)
31
c.Check(osenv.Home(), gc.Equals, drive+path2)
37
c.Check(utils.Home(), gc.Equals, drive+path2)