MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / test_duplicate

Method test_duplicate

tensorflow/python/autograph/pyct/anno_test.py:66–80  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

64 self.assertFalse(anno.hasanno(node_2, 'bar'))
65
66 def test_duplicate(self):
67 node = ast.If(
68 test=ast.Num(1),
69 body=[ast.Expr(ast.Name('bar', ast.Load()))],
70 orelse=[])
71 anno.setanno(node, 'spam', 1)
72 anno.setanno(node, 'ham', 1)
73 anno.setanno(node.body[0], 'ham', 1)
74
75 anno.dup(node, {'spam': 'eggs'})
76
77 self.assertTrue(anno.hasanno(node, 'spam'))
78 self.assertTrue(anno.hasanno(node, 'ham'))
79 self.assertTrue(anno.hasanno(node, 'eggs'))
80 self.assertFalse(anno.hasanno(node.body[0], 'eggs'))
81
82
83if __name__ == '__main__':

Callers

nothing calls this directly

Calls 3

IfMethod · 0.80
NameMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected