Skip to content

Commit

Permalink
add test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
laixintao committed Oct 19, 2023
1 parent 9f0807e commit e737fc2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_render/test_render_detail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from flameshow.models import Profile
from flameshow.render.framedetail import FrameStatAll
from ..utils import create_frame


def test_render_self_value_all_instance():
root = create_frame(
{
"id": 0,
"values": [10],
"children": [
{"id": 1, "values": [4], "children": []},
],
}
)
profile = Profile("asdf", root, 0, 0, [], {})
widget = FrameStatAll(root, profile, 0)
value = widget.frame_all_self_value
assert value == 6

child_frame = root.children[0]

widget = FrameStatAll(child_frame, profile, 0)
value = widget.frame_all_self_value
assert value == 4

0 comments on commit e737fc2

Please sign in to comment.