Beispiel #1
0
 def test_simple_lambda_inlining(self):
     tables = {}
     ret_ref = Flag()
     resp = _trace_value(lambda x: x + 5, tables, ret_ref)
     self.assertEqual(
         {}, tables,
         "trace_value should not have generated any tables for this lambda")
     self.assertIsInstance(
         resp, ContainerList,
         "trace_value should return a ContainerList describing the function"
     )
Beispiel #2
0
 def test_traceable_summary(self):
     thing = TraceableObject('x', 11)
     tables = {}
     ret_ref = Flag()
     resp = _trace_value(thing, tables, ret_ref)
     self.assertIsInstance(resp, HrefFEID, "trace_value should have returned an Href")
     self.assertEqual(1, len(tables), "trace_value should have generated 1 table")
     self.assertIn(resp.fe_id, tables, "Object summary table is missing")
     table = tables[resp.fe_id]
     self.assertEqual(len(table.kwargs), 2, "trace_value should have found 2 variables to display")
     self.assertIn('a', table.kwargs, "the variable 'a' should have been found")
     self.assertEqual(NoEscape(r"\seqsplit{`x'}"), table.kwargs['a'], "member variable value improperly recorded")
     self.assertIn('b', table.kwargs, "the variable 'b' should have been found")
     self.assertEqual(NoEscape(r"\seqsplit{11}"), table.kwargs['b'], "member variable value improperly recorded")