Revision f0b1bafe test/ganeti.cli_unittest.py

b/test/ganeti.cli_unittest.py
1 1
#!/usr/bin/python
2 2
#
3 3

  
4
# Copyright (C) 2008 Google Inc.
4
# Copyright (C) 2008, 2011 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
396 396
      ])
397 397

  
398 398
    self.assertEqual(cli.FormatQueryResult(response, header=True,
399
                                           separator="|"),
399
                                           separator="|", verbose=True),
400 400
      (cli.QR_UNKNOWN, [
401 401
      "ID|unk|Unavail|NoData|OffLine",
402 402
      "1|(unknown)|N||(offline)",
403 403
      "2|(unknown)|(nodata)|x|(offline)",
404 404
      "3|(unknown)|N|(unavail)|(offline)",
405 405
      ]))
406
    self.assertEqual(cli.FormatQueryResult(response, header=True,
407
                                           separator="|", verbose=False),
408
      (cli.QR_UNKNOWN, [
409
      "ID|unk|Unavail|NoData|OffLine",
410
      "1|??|N||*",
411
      "2|??|?|x|*",
412
      "3|??|N|-|*",
413
      ]))
406 414

  
407 415
  def testNoData(self):
408 416
    fields = [
......
452 460
      ])
453 461

  
454 462
    self.assertEqual(cli.FormatQueryResult(response, header=False,
455
                                           separator="|"),
463
                                           separator="|", verbose=True),
456 464
      (cli.QR_INCOMPLETE, [
457 465
      "1|N||(offline)",
458 466
      "2|(nodata)|x|abc",
459 467
      "3|N|(unavail)|(offline)",
460 468
      ]))
469
    self.assertEqual(cli.FormatQueryResult(response, header=False,
470
                                           separator="|", verbose=False),
471
      (cli.QR_INCOMPLETE, [
472
      "1|N||*",
473
      "2|?|x|abc",
474
      "3|N|-|*",
475
      ]))
461 476

  
462 477
  def testInvalidFieldType(self):
463 478
    fields = [

Also available in: Unified diff