Revision b166ef84 test/ganeti.rapi.baserlib_unittest.py

b/test/ganeti.rapi.baserlib_unittest.py
80 80
    self.assertRaises(http.HttpBadRequest, baserlib.FillOpcode,
81 81
                      self.OpTest, range(10), None)
82 82

  
83
  def testRenameBothSpecified(self):
84
    self.assertRaises(http.HttpBadRequest, baserlib.FillOpcode,
85
                      self.OpTest, { "old": 123, "new": 999, }, None,
86
                      rename={ "old": "new", })
87

  
88
  def testRename(self):
89
    value = "Hello World"
90
    op = baserlib.FillOpcode(self.OpTest, { "data": value, }, None,
91
                             rename={ "data": "test", })
92
    self.assertEqual(op.test, value)
93

  
94
  def testRenameStatic(self):
95
    self.assertRaises(http.HttpBadRequest, baserlib.FillOpcode,
96
                      self.OpTest, { "data": 0, }, { "test": None, },
97
                      rename={ "data": "test", })
98

  
83 99

  
84 100
if __name__ == "__main__":
85 101
  testutils.GanetiTestProgram()

Also available in: Unified diff