MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / test_stack_operations

Function test_stack_operations

tests/test_stack_frames.py:6–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def test_stack_operations():
7 s = Stack()
8 with pytest.raises(ValueError):
9 s.pop()
10
11 with pytest.raises(KeyError):
12 _ = s['g']
13
14 s['g'] = 'global_value'
15 assert s['g'] == 'global_value'
16 s.push()
17 assert s['g'] == 'global_value'
18 assert s.frame.previous is not None
19 assert s.frame.previous is s.bottom
20 assert s.frame is not s.bottom
21 with pytest.raises(KeyError):
22 _ = s['x']
23
24 s['x'] = 'local_value'
25 assert s['x'] == 'local_value'
26 s.pop()
27 assert s.frame.previous is None
28 assert s.bottom is s.frame
29 with pytest.raises(KeyError):
30 _ = s['x']
31
32
33def test_stack_copy():

Callers

nothing calls this directly

Calls 3

popMethod · 0.95
pushMethod · 0.95
StackClass · 0.90

Tested by

no test coverage detected