~ubuntu-branches/ubuntu/saucy/juju-core/saucy-updates

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/environs/sync/sync_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-09-03 14:22:22 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20130903142222-9mes2r8wqr0bs7lp
Tags: 1.13.3-0ubuntu1
New upstream point release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        authorized-keys: "not-really-one"
53
53
`)
54
54
        var err error
55
 
        s.targetEnv, err = environs.NewFromName("test-target")
 
55
        s.targetEnv, err = environs.PrepareFromName("test-target")
56
56
        c.Assert(err, gc.IsNil)
57
57
        envtesting.RemoveAllTools(c, s.targetEnv)
58
58
 
92
92
}{
93
93
        {
94
94
                description: "copy newest from the filesystem",
95
 
                ctx: &sync.SyncContext{
96
 
                        EnvName: "test-target",
97
 
                },
 
95
                ctx:         &sync.SyncContext{},
98
96
                source:      true,
99
97
                tools:       v100all,
100
98
                emptyPublic: true,
101
99
        },
102
100
        {
103
101
                description: "copy newest from the dummy environment",
104
 
                ctx: &sync.SyncContext{
105
 
                        EnvName: "test-target",
106
 
                },
 
102
                ctx:         &sync.SyncContext{},
107
103
                tools:       v100all,
108
104
                emptyPublic: true,
109
105
        },
110
106
        {
111
107
                description: "copy newest dev from the dummy environment",
112
108
                ctx: &sync.SyncContext{
113
 
                        EnvName: "test-target",
114
 
                        Dev:     true,
 
109
                        Dev: true,
115
110
                },
116
111
                tools:       v190all,
117
112
                emptyPublic: true,
119
114
        {
120
115
                description: "copy all from the dummy environment",
121
116
                ctx: &sync.SyncContext{
122
 
                        EnvName:     "test-target",
123
117
                        AllVersions: true,
124
118
                },
125
119
                tools:       v100all,
128
122
        {
129
123
                description: "copy all and dev from the dummy environment",
130
124
                ctx: &sync.SyncContext{
131
 
                        EnvName:     "test-target",
132
125
                        AllVersions: true,
133
126
                        Dev:         true,
134
127
                },
138
131
        {
139
132
                description: "copy to the dummy environment public storage",
140
133
                ctx: &sync.SyncContext{
141
 
                        EnvName:      "test-target",
142
134
                        PublicBucket: true,
143
135
                },
144
136
                tools:       v100all,
147
139
}
148
140
 
149
141
func (s *syncSuite) TestSyncing(c *gc.C) {
150
 
        for _, test := range tests {
 
142
        for i, test := range tests {
151
143
                // Perform all tests in a "clean" environment.
152
144
                func() {
153
145
                        s.setUpTest(c)
154
146
                        defer s.tearDownTest(c)
155
147
 
156
 
                        c.Log(test.description)
 
148
                        c.Logf("test %d: %s", i, test.description)
157
149
 
158
150
                        if test.source {
159
151
                                test.ctx.Source = s.localStorage
160
152
                        }
 
153
                        test.ctx.Target = s.targetEnv
161
154
 
162
155
                        err := sync.SyncTools(test.ctx)
163
156
                        c.Assert(err, gc.IsNil)
181
174
 
182
175
        envtesting.UploadFakeToolsVersion(c, s.targetEnv.Storage(), v200p64)
183
176
        ctx := &sync.SyncContext{
184
 
                EnvName:      "test-target",
 
177
                Target:       s.targetEnv,
185
178
                PublicBucket: true,
186
179
        }
187
180
        err := sync.SyncTools(ctx)