~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/resource/cmd/output_tabular_test.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
283
283
        data := FormattedServiceDetails{
284
284
                Resources: []FormattedDetailResource{
285
285
                        {
286
 
                                UnitID:     "svc/10",
287
 
                                unitNumber: 10,
288
 
                                Unit:       fakeFmtSvcRes("data", "1"),
289
 
                                Expected:   fakeFmtSvcRes("data", "1"),
 
286
                                UnitID:      "svc/10",
 
287
                                unitNumber:  10,
 
288
                                Unit:        fakeFmtSvcRes("data", "1"),
 
289
                                Expected:    fakeFmtSvcRes("data", "1"),
 
290
                                Progress:    17,
 
291
                                progress:    "17%",
 
292
                                revProgress: "combRev1 (fetching: 17%)",
290
293
                        },
291
294
                        {
292
 
                                UnitID:     "svc/5",
293
 
                                unitNumber: 5,
294
 
                                Unit:       fakeFmtSvcRes("config", "2"),
295
 
                                Expected:   fakeFmtSvcRes("config", "3"),
 
295
                                UnitID:      "svc/5",
 
296
                                unitNumber:  5,
 
297
                                Unit:        fakeFmtSvcRes("config", "2"),
 
298
                                Expected:    fakeFmtSvcRes("config", "3"),
 
299
                                revProgress: "combRev3",
296
300
                        },
297
301
                },
298
302
                Updates: updates,
305
309
[Units]
306
310
UNIT RESOURCE REVISION EXPECTED
307
311
5    config   combRev2 combRev3
308
 
10   data     combRev1 combRev1
 
312
10   data     combRev1 combRev1 (fetching: 17%)
309
313
 
310
314
[Updates Available]
311
315
RESOURCE REVISION
316
320
func (s *DetailsTabularSuite) TestFormatUnitDetailsOkay(c *gc.C) {
317
321
        data := FormattedUnitDetails{
318
322
                {
319
 
                        UnitID:     "svc/10",
320
 
                        unitNumber: 10,
321
 
                        Unit:       fakeFmtSvcRes("data", "1"),
322
 
                        Expected:   fakeFmtSvcRes("data", "1"),
 
323
                        UnitID:      "svc/10",
 
324
                        unitNumber:  10,
 
325
                        Unit:        fakeFmtSvcRes("data", "1"),
 
326
                        Expected:    fakeFmtSvcRes("data", "1"),
 
327
                        revProgress: "combRev1",
323
328
                },
324
329
                {
325
 
                        UnitID:     "svc/10",
326
 
                        unitNumber: 10,
327
 
                        Unit:       fakeFmtSvcRes("config", "2"),
328
 
                        Expected:   fakeFmtSvcRes("config", "3"),
 
330
                        UnitID:      "svc/10",
 
331
                        unitNumber:  10,
 
332
                        Unit:        fakeFmtSvcRes("config", "2"),
 
333
                        Expected:    fakeFmtSvcRes("config", "3"),
 
334
                        Progress:    91,
 
335
                        progress:    "91%",
 
336
                        revProgress: "combRev3 (fetching: 91%)",
329
337
                },
330
338
        }
331
339
 
335
343
        c.Assert(string(output), gc.Equals, `
336
344
[Unit]
337
345
RESOURCE REVISION EXPECTED
338
 
config   combRev2 combRev3
 
346
config   combRev2 combRev3 (fetching: 91%)
339
347
data     combRev1 combRev1
340
348
`[1:])
341
349
}
350
358
                Description:      "Desc" + suffix,
351
359
                Revision:         1,
352
360
                Fingerprint:      "Fingerprint" + suffix,
353
 
                Size:             1,
 
361
                Size:             100,
354
362
                Origin:           "Origin" + suffix,
355
363
                Used:             true,
356
364
                Timestamp:        time.Date(2012, 12, 12, 12, 12, 12, 0, time.UTC),