示例#1
0
 def testPopManyHeterogenous(self):
     l = FlexList([CharObject(u'm'), IntObject(5)])
     result = l.call(u"pop", [])
     self.assertEqual(result.getInt(), 5)
示例#2
0
 def testPutSize(self):
     l = FlexList([IntObject(5), CharObject(u'a')])
     l.put(1, IntObject(7))
     expected = [IntObject(5), IntObject(7)]
     self.assertEqual(l.strategy.size(l), len(expected))
示例#3
0
 def testPopMany(self):
     l = FlexList([IntObject(42), IntObject(5)])
     result = l.call(u"pop", [])
     self.assertEqual(result.getInt(), 5)
示例#4
0
 def testToStringMany(self):
     l = FlexList([IntObject(5), IntObject(42)])
     self.assertEqual(l.toString(), u"[5, 42].diverge()")
示例#5
0
 def testContains(self):
     l = FlexList([IntObject(5), CharObject(u'a')])
     self.assertTrue(l.contains(IntObject(5)))
     self.assertFalse(l.contains(IntObject(42)))
     self.assertFalse(l.contains(l))
示例#6
0
 def testToStringEmpty(self):
     l = FlexList([])
     self.assertEqual(l.toString(), u"[].diverge()")
示例#7
0
 def testToStringOne(self):
     l = FlexList([IntObject(42)])
     self.assertEqual(l.toString(), u"[42].diverge()")
示例#8
0
 def testPutSize(self):
     l = FlexList([IntObject(5), CharObject(u'a')])
     l.put(1, IntObject(7))
     expected = [IntObject(5), IntObject(7)]
     self.assertEqual(l.strategy.size(l), len(expected))
示例#9
0
 def testPopMany(self):
     l = FlexList([IntObject(42), IntObject(5)])
     result = l.call(u"pop", [])
     self.assertEqual(result.getInt(), 5)
示例#10
0
 def testContains(self):
     l = FlexList([IntObject(5), CharObject(u'a')])
     self.assertTrue(l.contains(IntObject(5)))
     self.assertFalse(l.contains(IntObject(42)))
     self.assertFalse(l.contains(l))
示例#11
0
 def testToStringMany(self):
     l = FlexList([IntObject(5), IntObject(42)])
     self.assertEqual(l.toString(), u"[5, 42].diverge()")
示例#12
0
 def testToStringOne(self):
     l = FlexList([IntObject(42)])
     self.assertEqual(l.toString(), u"[42].diverge()")
示例#13
0
 def testToStringEmpty(self):
     l = FlexList([])
     self.assertEqual(l.toString(), u"[].diverge()")
示例#14
0
 def testPopManyHeterogenous(self):
     l = FlexList([CharObject(u'm'), IntObject(5)])
     result = l.call(u"pop", [])
     self.assertEqual(result.getInt(), 5)