Ejemplo n.º 1
0
 def testOtherReversal(self):
     '''Collector << OtherObjectType # libother << operator'''
     collector = Collector()
     obj = OtherObjectType()
     collector << obj
     self.assertEqual(collector.items()[0], obj.identifier() * 2)
 def testOtherReversal(self):
     '''Collector << OtherObjectType # libother << operator'''
     collector = Collector()
     obj = OtherObjectType()
     collector << obj
     self.assertEqual(collector.items()[0], obj.identifier() * 2)
Ejemplo n.º 3
0
 def testLShiftWithExpectedType(self):
     '''Collector << ObjectType # libsample << operator'''
     collector = Collector()
     obj = ObjectType()
     collector << obj
     self.assertEqual(collector.items()[0], obj.identifier())
Ejemplo n.º 4
0
 def testBasic(self):
     '''Collector << ObjectType # greedy collector'''
     collector = Collector()
     obj = ObjectType()
     collector << obj
     self.assertEqual(collector.items()[0], obj.identifier())
 def testLShiftWithExpectedType(self):
     '''Collector << ObjectType # libsample << operator'''
     collector = Collector()
     obj = ObjectType()
     collector << obj
     self.assertEqual(collector.items()[0], obj.identifier())
Ejemplo n.º 6
0
 def testLShiftOperatorMultipleUses(self):
     '''Test case for using the Collector.__lshift__ operator many times in the same line.'''
     collector = Collector()
     collector << 2 << 3 << 5 << 7 << 11
     self.assertEqual(collector.size(), 5)
     self.assertEqual(collector.items(), [2, 3, 5, 7, 11])
Ejemplo n.º 7
0
 def testLShiftExternal(self):
     '''Collector external operator'''
     collector = Collector()
     collector << IntWrapper(5)
     self.assertEqual(collector.size(), 1)
     self.assertEqual(collector.items(), [5])
Ejemplo n.º 8
0
 def testLShiftOperatorSingleUse(self):
     '''Test case for using the Collector.__lshift__ operator just one time.'''
     collector = Collector()
     collector << 13
     self.assertEqual(collector.size(), 1)
     self.assertEqual(collector.items(), [13])
Ejemplo n.º 9
0
 def testBasic(self):
     '''Collector << ObjectType # greedy collector'''
     collector = Collector()
     obj = ObjectType()
     collector << obj
     self.assertEqual(collector.items()[0], obj.identifier())
Ejemplo n.º 10
0
 def testLShiftExternal(self):
     '''Collector external operator'''
     collector = Collector()
     collector << IntWrapper(5)
     self.assertEqual(collector.size(), 1)
     self.assertEqual(collector.items(), [5])
Ejemplo n.º 11
0
 def testLShiftOperatorMultipleUses(self):
     '''Test case for using the Collector.__lshift__ operator many times in the same line.'''
     collector = Collector()
     collector << 2 << 3 << 5 << 7 << 11
     self.assertEqual(collector.size(), 5)
     self.assertEqual(collector.items(), [2, 3, 5, 7, 11])
Ejemplo n.º 12
0
 def testLShiftOperatorSingleUse(self):
     '''Test case for using the Collector.__lshift__ operator just one time.'''
     collector = Collector()
     collector << 13
     self.assertEqual(collector.size(), 1)
     self.assertEqual(collector.items(), [13])