Exemple #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)
Exemple #3
0
 def testLShiftWithExpectedType(self):
     '''Collector << ObjectType # libsample << operator'''
     collector = Collector()
     obj = ObjectType()
     collector << obj
     self.assertEqual(collector.items()[0], obj.identifier())
 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())
 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])
 def testLShiftExternal(self):
     '''Collector external operator'''
     collector = Collector()
     collector << IntWrapper(5)
     self.assertEqual(collector.size(), 1)
     self.assertEqual(collector.items(), [5])
 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])
Exemple #9
0
 def testBasic(self):
     '''Collector << ObjectType # greedy collector'''
     collector = Collector()
     obj = ObjectType()
     collector << obj
     self.assertEqual(collector.items()[0], obj.identifier())
Exemple #10
0
 def testLShiftExternal(self):
     '''Collector external operator'''
     collector = Collector()
     collector << IntWrapper(5)
     self.assertEqual(collector.size(), 1)
     self.assertEqual(collector.items(), [5])
Exemple #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])
Exemple #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])