Revision 8c114acd test/ganeti.cli_unittest.py

b/test/ganeti.cli_unittest.py
43 43
  def testValidTimes(self):
44 44
    """Test valid timespecs"""
45 45
    test_data = [
46
      ('1s', 1),
47
      ('1', 1),
48
      ('1m', 60),
49
      ('1h', 60 * 60),
50
      ('1d', 60 * 60 * 24),
51
      ('1w', 60 * 60 * 24 * 7),
52
      ('4h', 4 * 60 * 60),
53
      ('61m', 61 * 60),
46
      ("1s", 1),
47
      ("1", 1),
48
      ("1m", 60),
49
      ("1h", 60 * 60),
50
      ("1d", 60 * 60 * 24),
51
      ("1w", 60 * 60 * 24 * 7),
52
      ("4h", 4 * 60 * 60),
53
      ("61m", 61 * 60),
54 54
      ]
55 55
    for value, expected_result in test_data:
56 56
      self.failUnlessEqual(cli.ParseTimespec(value), expected_result)
......
58 58
  def testInvalidTime(self):
59 59
    """Test invalid timespecs"""
60 60
    test_data = [
61
      '1y',
62
      '',
63
      'aaa',
64
      's',
61
      "1y",
62
      "",
63
      "aaa",
64
      "s",
65 65
      ]
66 66
    for value in test_data:
67 67
      self.failUnlessRaises(OpPrereqError, cli.ParseTimespec, value)
......
128 128
                 ]:
129 129
      buf = StringIO()
130 130
      cli._ToStream(buf, data)
131
      self.failUnlessEqual(buf.getvalue(), data+'\n')
131
      self.failUnlessEqual(buf.getvalue(), data + "\n")
132 132

  
133 133
  def testParams(self):
134 134
      buf = StringIO()

Also available in: Unified diff