MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / test_stack_copy

Function test_stack_copy

tests/test_stack_frames.py:33–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32
33def test_stack_copy():
34 s1 = Stack()
35 s1['var'] = 'value1'
36 assert s1['var'] == 'value1'
37
38 s1.push()
39 s1['another'] = 'value2'
40 assert s1['var'] == 'value1'
41 assert s1['another'] == 'value2'
42
43 s2 = s1.copy()
44 assert s1 is not s2
45 assert set(s1.frame.variables) == set(s2.frame.variables)
46 assert s2.frame is not s1.frame
47 assert s2.bottom is not s1.bottom
48 assert s2.frame is not s2.bottom
49 assert s2['var'] == 'value1'
50 assert s2['another'] == 'value2'
51
52 s2['var'] = 'new_value'
53 assert s2['var'] == 'new_value'
54 assert s1['var'] == 'value1'

Callers

nothing calls this directly

Calls 3

pushMethod · 0.95
copyMethod · 0.95
StackClass · 0.90

Tested by

no test coverage detected