Beispiel #1
0
 def test__eq__2(self):
     n = NUMBER(1, lineno=1)
     b = BLOCK.make_node(n)
     self.assertEqual(b, b)
     q = BLOCK()
     self.assertNotEqual(b, q)
     self.assertNotEqual(q, None)
     self.assertNotEqual(None, q)
     self.assertNotEqual(q, 'STRING')
Beispiel #2
0
 def test_make_node_optimize2(self):
     n = NUMBER(1, lineno=1)
     b = BLOCK.make_node(BLOCK(n), n, BLOCK(n))
     self.assertEqual(len(b), 3)
     for x in b:
         self.assertIsInstance(x, NUMBER)
Beispiel #3
0
 def test__eq__(self):
     b = BLOCK()
     self.assertEqual(b, b)
     q = BLOCK()
     self.assertEqual(b, q)
Beispiel #4
0
 def test_getitem__error(self):
     n = NUMBER(1, lineno=1)
     b = BLOCK.make_node(n)
     self.assertRaises(IndexError, b.__getitem__, len(b))
Beispiel #5
0
 def test_make_node_optimize1(self):
     b = BLOCK.make_node(BLOCK(NUMBER(1, lineno=1)))
     self.assertIsInstance(b[0], NUMBER)
Beispiel #6
0
 def test__getitem__0(self):
     n = NUMBER(1, lineno=1)
     b = BLOCK.make_node(n)
     self.assertEqual(b[0], n)
Beispiel #7
0
 def test__len__(self):
     b = BLOCK.make_node(NUMBER(1, lineno=1))
     self.assertEqual(len(b), 1)
Beispiel #8
0
 def test_make_node_simple(self):
     b = BLOCK.make_node(NUMBER(1, lineno=1))
     self.assertIsInstance(b, BLOCK)
Beispiel #9
0
 def test_make_node_empty2(self):
     b = BLOCK.make_node(None, None)
     self.assertEqual(b, BLOCK())
Beispiel #10
0
 def test_make_node_empty(self):
     BLOCK.make_node()