Ignore:
Timestamp:
30 Aug 2012, 08:11:58 (12 years ago)
Author:
Henrik Bettermann
Message:

Catch errors and return message removed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/tests/test_objecthistory.py

    r9125 r9126  
    108108        hist.addMessage('blah')
    109109        hist.addMessage('blow')
    110         self.assertEqual(len(hist._getMessages()),2)
     110        self.assertEqual(len(hist._getMessages()), 2)
    111111        result = ' '.join(hist.messages)
    112112        self.assertTrue('blah by Bob' in result)
    113113        self.assertTrue('blow by Bob' in result)
    114         hist.removeMessage(1)
    115         self.assertEqual(len(hist._getMessages()),1)
     114        success, text = hist.removeMessage('xyz')
     115        self.assertFalse(success)
     116        self.assertEqual(text, 'Not a number')
     117        success, text = hist.removeMessage(100)
     118        self.assertFalse(success)
     119        self.assertEqual(text, 'Number out of range')
     120        success, text = hist.removeMessage(1)
     121        self.assertTrue(success)
     122        self.assertMatches('<YYYY-MM-DD hh:mm:ss> UTC - blow by Bob', text)
     123        self.assertEqual(len(hist.messages), 1)
    116124        result = ' '.join(hist.messages)
    117125        self.assertFalse('blow by Bob' in result)
Note: See TracChangeset for help on using the changeset viewer.