def test_entity_to_graph_function_with_defaults(self):
    b = 2
    c = 1

    def f(a, d=(c + 1)):
        return ((a + b) + d)
    program_ctx = self._simple_program_ctx()
    (nodes, name, _) = conversion.entity_to_graph(f, program_ctx, None, None)
    (fn_node, _) = nodes
    self.assertIsInstance(fn_node, gast.FunctionDef)
    self.assertEqual('tf__f', name)
    self.assertEqual(compiler.ast_to_source(fn_node.args.defaults[0]).strip(), 'None')
def test_entity_to_graph_function_with_defaults(self):
    b = 2
    c = 1

    def f(a, d=(c + 1)):
        return ((a + b) + d)
    program_ctx = self._simple_program_ctx()
    (nodes, name, _) = conversion.entity_to_graph(f, program_ctx, None, None)
    (fn_node, _) = nodes
    self.assertIsInstance(fn_node, gast.FunctionDef)
    self.assertEqual('tf__f', name)
    self.assertEqual(compiler.ast_to_source(fn_node.args.defaults[0]).strip(), 'None')