def test_partlyIncompleteTestWithChange(self):
     changed = ContextFree.remove_nongenerating_nonterminals(
         self.g, transform_grammar=True)
     self.assertEqual(id(changed), id(self.g))
     self.assertTrue(self.g.have_term([0, 1]))
     self.assertTrue(self.g.have_nonterm([A, B]))
     self.assertFalse(self.g.have_nonterm(C))
 def test_partlyIncompleteTestWithoutChange(self):
     ContextFree.remove_nongenerating_nonterminals(self.g)
     self.assertTrue(self.g.have_term([0, 1]))
     self.assertTrue(self.g.have_nonterm([A, B, C]))
 def test_partlyIncompleteTest(self):
     changed = ContextFree.remove_nongenerating_nonterminals(self.g)
     self.assertTrue(changed.have_term([0, 1]))
     self.assertTrue(changed.have_nonterm([A, B]))
     self.assertFalse(changed.have_nonterm(C))