diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-07 14:59:28 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-07 14:59:28 (GMT) |
commit | 6d5bc75092b0b68042c943cef694fea7999722ea (patch) | |
tree | 79d0bbb93663286eb87b5ded31ad9eb19ce7e922 /tests | |
parent | fb019bc9f5a93231d9dc63a2f323db6881a048a3 (diff) |
Tweak the test to use realistic numbers. Some fixes
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test-snowflake-box.py | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/tests/test-snowflake-box.py b/tests/test-snowflake-box.py index eb7efb9..45f3c0a 100755 --- a/tests/test-snowflake-box.py +++ b/tests/test-snowflake-box.py @@ -17,7 +17,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys -import random +from random import random import pygtk pygtk.require('2.0') @@ -33,14 +33,14 @@ from sugar.graphics.canvasicon import CanvasIcon def _create_snowflake(parent, children): color = XoColor() - icon = CanvasIcon(scale=1.0, xo_color=color, + icon = CanvasIcon(scale=0.8, xo_color=color, icon_name='theme:object-link') parent.append(icon, hippo.PACK_FIXED) parent.set_root(icon) for i in range(0, children): color = XoColor() - icon = CanvasIcon(scale=0.5, xo_color=color, + icon = CanvasIcon(scale=0.4, xo_color=color, icon_name='theme:stock-buddy') parent.append(icon, hippo.PACK_FIXED) @@ -58,25 +58,10 @@ box = SnowflakeBox() snow_flake = _create_snowflake(box, 0) root_box.set_center_item(box) -box = SnowflakeBox() -snow_flake = _create_snowflake(box, 30) -root_box.add_item(box) - -box = SnowflakeBox() -snow_flake = _create_snowflake(box, 15) -root_box.add_item(box) - -box = SnowflakeBox() -snow_flake = _create_snowflake(box, 10) -root_box.add_item(box) - -box = SnowflakeBox() -snow_flake = _create_snowflake(box, 5) -root_box.add_item(box) - -box = SnowflakeBox() -snow_flake = _create_snowflake(box, 2) -root_box.add_item(box) +for i in range(0, 30): + box = SnowflakeBox() + snow_flake = _create_snowflake(box, int(2 + random() * 8)) + root_box.add_item(box) canvas.show() window.add(canvas) |