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

Side by Side Diff: cmd/juju/synctools_test.go

Issue 78660045: cmd: No longer panic if cwd is deleted (Closed)
Patch Set: cmd: No longer panic if cwd is deleted Created 11 years 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:
View unified diff | Download patch
« no previous file with comments | « cmd/juju/main.go ('k') | cmd/jujud/main.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 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 main 4 package main
5 5
6 import ( 6 import (
7 "errors" 7 "errors"
8 "time" 8 "time"
9 9
10 "github.com/juju/loggo" 10 "github.com/juju/loggo"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 sctx: &sync.SyncContext{ 118 sctx: &sync.SyncContext{
119 MajorVersion: 1, 119 MajorVersion: 1,
120 MinorVersion: 2, 120 MinorVersion: 2,
121 }, 121 },
122 }, 122 },
123 } 123 }
124 124
125 func (s *syncToolsSuite) TestSyncToolsCommand(c *gc.C) { 125 func (s *syncToolsSuite) TestSyncToolsCommand(c *gc.C) {
126 for i, test := range syncToolsCommandTests { 126 for i, test := range syncToolsCommandTests {
127 c.Logf("test %d: %s", i, test.description) 127 c.Logf("test %d: %s", i, test.description)
128 » » targetEnv, err := environs.PrepareFromName("test-target", nullCo ntext(), s.configStore) 128 » » targetEnv, err := environs.PrepareFromName("test-target", nullCo ntext(c), s.configStore)
129 c.Assert(err, gc.IsNil) 129 c.Assert(err, gc.IsNil)
130 called := false 130 called := false
131 syncTools = func(sctx *sync.SyncContext) error { 131 syncTools = func(sctx *sync.SyncContext) error {
132 c.Assert(sctx.AllVersions, gc.Equals, test.sctx.AllVersi ons) 132 c.Assert(sctx.AllVersions, gc.Equals, test.sctx.AllVersi ons)
133 c.Assert(sctx.MajorVersion, gc.Equals, test.sctx.MajorVe rsion) 133 c.Assert(sctx.MajorVersion, gc.Equals, test.sctx.MajorVe rsion)
134 c.Assert(sctx.MinorVersion, gc.Equals, test.sctx.MinorVe rsion) 134 c.Assert(sctx.MinorVersion, gc.Equals, test.sctx.MinorVe rsion)
135 c.Assert(sctx.DryRun, gc.Equals, test.sctx.DryRun) 135 c.Assert(sctx.DryRun, gc.Equals, test.sctx.DryRun)
136 c.Assert(sctx.Dev, gc.Equals, test.sctx.Dev) 136 c.Assert(sctx.Dev, gc.Equals, test.sctx.Dev)
137 c.Assert(sctx.Public, gc.Equals, test.sctx.Public) 137 c.Assert(sctx.Public, gc.Equals, test.sctx.Public)
138 c.Assert(sctx.Source, gc.Equals, test.sctx.Source) 138 c.Assert(sctx.Source, gc.Equals, test.sctx.Source)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 193 }
194 // Run sync-tools command with --destination flag. 194 // Run sync-tools command with --destination flag.
195 ctx, err := runSyncToolsCommand(c, "-e", "test-target", "--destination", dir) 195 ctx, err := runSyncToolsCommand(c, "-e", "test-target", "--destination", dir)
196 c.Assert(err, gc.IsNil) 196 c.Assert(err, gc.IsNil)
197 c.Assert(ctx, gc.NotNil) 197 c.Assert(ctx, gc.NotNil)
198 c.Assert(called, jc.IsTrue) 198 c.Assert(called, jc.IsTrue)
199 // Check deprecated message was logged. 199 // Check deprecated message was logged.
200 c.Check(tw.Log, jc.LogMatches, messages) 200 c.Check(tw.Log, jc.LogMatches, messages)
201 s.Reset(c) 201 s.Reset(c)
202 } 202 }
OLDNEW
« no previous file with comments | « cmd/juju/main.go ('k') | cmd/jujud/main.go » ('j') | no next file with comments »

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