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

Delta Between Two Patch Sets: juju/conn_test.go

Issue 29130043: juju: fix minor bug; add bug comment
Left Patch Set: Created 10 years, 4 months ago
Right Patch Set: juju: fix minor bug; add bug comment Created 10 years, 4 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
« juju/conn.go ('K') | « juju/conn.go ('k') | no next file » | 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 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 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 juju_test 4 package juju_test
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 "io/ioutil" 8 "io/ioutil"
9 "os" 9 "os"
10 "path/filepath" 10 "path/filepath"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 id3, err := units[0].AssignedMachineId() 406 id3, err := units[0].AssignedMachineId()
407 c.Assert(id3, gc.Equals, id0+"/lxc/0") 407 c.Assert(id3, gc.Equals, id0+"/lxc/0")
408 408
409 units, err = s.conn.AddUnits(svc, 1, "lxc:"+id3) 409 units, err = s.conn.AddUnits(svc, 1, "lxc:"+id3)
410 c.Assert(err, gc.IsNil) 410 c.Assert(err, gc.IsNil)
411 id4, err := units[0].AssignedMachineId() 411 id4, err := units[0].AssignedMachineId()
412 c.Assert(id4, gc.Equals, id0+"/lxc/0/lxc/0") 412 c.Assert(id4, gc.Equals, id0+"/lxc/0/lxc/0")
413 413
414 // Check that all but the first colon is left alone. 414 // Check that all but the first colon is left alone.
415 _, err = s.conn.AddUnits(svc, 1, "lxc:"+strings.Replace(id3, "/", ":", - 1)) 415 _, err = s.conn.AddUnits(svc, 1, "lxc:"+strings.Replace(id3, "/", ":", - 1))
416 » c.Assert(err, gc.IsNil) 416 » c.Assert(err, gc.ErrorMatches, `invalid force machine id ".*"`)
417 } 417 }
418 418
419 // DeployLocalSuite uses a fresh copy of the same local dummy charm for each 419 // DeployLocalSuite uses a fresh copy of the same local dummy charm for each
420 // test, because DeployService demands that a charm already exists in state, 420 // test, because DeployService demands that a charm already exists in state,
421 // and that's is the simplest way to get one in there. 421 // and that's is the simplest way to get one in there.
422 type DeployLocalSuite struct { 422 type DeployLocalSuite struct {
423 testing.JujuConnSuite 423 testing.JujuConnSuite
424 repo charm.Repository 424 repo charm.Repository
425 charm *state.Charm 425 charm *state.Charm
426 oldCacheDir string 426 oldCacheDir string
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 c.Assert(err, gc.ErrorMatches, "cannot determine juju home.*") 654 c.Assert(err, gc.ErrorMatches, "cannot determine juju home.*")
655 } 655 }
656 656
657 func (s *InitJujuHomeSuite) TestCacheDir(c *gc.C) { 657 func (s *InitJujuHomeSuite) TestCacheDir(c *gc.C) {
658 os.Setenv("JUJU_HOME", "/foo/bar") 658 os.Setenv("JUJU_HOME", "/foo/bar")
659 c.Assert(charm.CacheDir, gc.Equals, "") 659 c.Assert(charm.CacheDir, gc.Equals, "")
660 err := juju.InitJujuHome() 660 err := juju.InitJujuHome()
661 c.Assert(err, gc.IsNil) 661 c.Assert(err, gc.IsNil)
662 c.Assert(charm.CacheDir, gc.Equals, "/foo/bar/charmcache") 662 c.Assert(charm.CacheDir, gc.Equals, "/foo/bar/charmcache")
663 } 663 }
LEFTRIGHT
« juju/conn.go ('k') | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

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