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

Method test_basic

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

Source from the content-addressed store, hash-verified

30class AnnoTest(test.TestCase):
31
32 def test_basic(self):
33 node = ast.Name()
34
35 self.assertEqual(anno.keys(node), set())
36 self.assertFalse(anno.hasanno(node, 'foo'))
37 with self.assertRaises(AttributeError):
38 anno.getanno(node, 'foo')
39
40 anno.setanno(node, 'foo', 3)
41
42 self.assertEqual(anno.keys(node), {'foo'})
43 self.assertTrue(anno.hasanno(node, 'foo'))
44 self.assertEqual(anno.getanno(node, 'foo'), 3)
45 self.assertEqual(anno.getanno(node, 'bar', default=7), 7)
46
47 anno.delanno(node, 'foo')
48
49 self.assertEqual(anno.keys(node), set())
50 self.assertFalse(anno.hasanno(node, 'foo'))
51 with self.assertRaises(AttributeError):
52 anno.getanno(node, 'foo')
53 self.assertIsNone(anno.getanno(node, 'foo', default=None))
54
55 def test_copy(self):
56 node_1 = ast.Name()

Callers

nothing calls this directly

Calls 2

NameMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected