Revision aa922d64 test/py/ganeti.backend_unittest.py

b/test/py/ganeti.backend_unittest.py
538 538
      self._Test("inst1.example.com", idx)
539 539

  
540 540

  
541
class TestInstReason(unittest.TestCase):
542
  def testGetJson(self):
543
    reason_text = "OS Update"
544
    reason_source = constants.INSTANCE_REASON_SOURCE_CLI
545
    origDict = dict(text=reason_text, source=reason_source)
546

  
547
    reason = backend.InstReason(reason_source, reason_text)
548
    json = reason.GetJson()
549
    resultDict = serializer.LoadJson(json)
550

  
551
    self.assertEqual(origDict, resultDict)
552

  
553

  
554 541
if __name__ == "__main__":
555 542
  testutils.GanetiTestProgram()

Also available in: Unified diff