From 72647558891dff9d80aa9013f3bd6a82fe53753e Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Tue, 30 Mar 2010 14:37:23 -0300 Subject: Extended extended reverse shift operator test. Just added the basic case of "Collector << ObjectType". --- tests/otherbinding/collector_external_operator_test.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/otherbinding') diff --git a/tests/otherbinding/collector_external_operator_test.py b/tests/otherbinding/collector_external_operator_test.py index 28b2d65d7..58a23d2b0 100644 --- a/tests/otherbinding/collector_external_operator_test.py +++ b/tests/otherbinding/collector_external_operator_test.py @@ -26,21 +26,27 @@ '''Test cases for Collector shift operators defined in other modules.''' -import sys import unittest -from sample import Collector +from sample import Collector, ObjectType from other import OtherObjectType class CollectorOtherObjectType(unittest.TestCase): '''Test cases for Collector << OtherObjectType''' + def testLShiftWithExpectedType(self): + '''Collector << ObjectType # libsample << operator''' + collector = Collector() + obj = ObjectType() + collector << obj + self.assertEqual(collector.items()[0], obj.identifier()) + def testOtherReversal(self): '''Collector << OtherObjectType # libother << operator''' collector = Collector() obj = OtherObjectType() collector << obj - self.assertEqual(collector.items()[0], obj.identifier()*2) + self.assertEqual(collector.items()[0], obj.identifier() * 2) if __name__ == '__main__': unittest.main() -- cgit v1.2.3