diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-05-07 20:12:38 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-05-07 20:12:38 +0200 |
commit | cdf5c00cfef5a382f2a998d802ff69a13fe152c4 (patch) | |
tree | e143bef53d63b8817922b2199942a587b3c071e4 | |
parent | 553c77075a35347ea96c646ef19a9188ae096018 (diff) | |
download | pyexiv2-cdf5c00cfef5a382f2a998d802ff69a13fe152c4.tar.gz |
Completed the test_no_listener and test_listener_interface tests.
-rw-r--r-- | unittest/notifying_list.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/unittest/notifying_list.py b/unittest/notifying_list.py index fa7646b..346216b 100644 --- a/unittest/notifying_list.py +++ b/unittest/notifying_list.py @@ -59,7 +59,18 @@ class TestNotifyingList(unittest.TestCase): def test_no_listener(self): # No listener is registered, nothing should happen. self.values[3] = 13 - # TODO: test all operations (insertion, deletion, slicing, ...) + del self.values[5] + self.values.append(17) + self.values.extend([11, 22]) + self.values.insert(4, 24) + self.values.pop() + self.values.remove(9) + self.values.reverse() + self.values.sort() + self.values += [8, 4] + self.values *= 3 + self.values[3:4] = [8, 4] + del self.values[3:5] def test_listener_interface(self): self.values.register_listener(ListenerInterface()) @@ -71,7 +82,14 @@ class TestNotifyingList(unittest.TestCase): self.failUnlessRaises(NotImplementedError, self.values.insert, 4, 24) self.failUnlessRaises(NotImplementedError, self.values.pop) self.failUnlessRaises(NotImplementedError, self.values.remove, 9) - # TODO: test all operations (insertion, slicing, ...) + self.failUnlessRaises(NotImplementedError, self.values.reverse) + self.failUnlessRaises(NotImplementedError, self.values.sort) + self.failUnlessRaises(NotImplementedError, self.values.__iadd__, [8, 4]) + self.failUnlessRaises(NotImplementedError, self.values.__imul__, 3) + self.failUnlessRaises(NotImplementedError, self.values.__setslice__, + 3, 4, [8, 4]) + self.failUnlessRaises(NotImplementedError, self.values.__delslice__, + 3, 5) def _register_listeners(self): # Register a random number of listeners |