From 71befb17bab0113b39aae26e4204de9c585f5a17 Mon Sep 17 00:00:00 2001 From: Tim McNamara Date: Sat, 14 Aug 2010 20:44:11 +0000 Subject: Moving breaking script script_calculate.py no longer works, as the widget identification system doesn't function properly with current versions of Sugar. I've moved the troublesome script into a staging area until I learn more about how the system works. --- (limited to 'Experior.Activity/script_calculate.py.orig') diff --git a/Experior.Activity/script_calculate.py.orig b/Experior.Activity/script_calculate.py.orig new file mode 100755 index 0000000..93f0fa4 --- /dev/null +++ b/Experior.Activity/script_calculate.py.orig @@ -0,0 +1,35 @@ +import time +import logging + +sugarActivityName = 'Calculate' + +def sugarbot_main(widgets): + # Test 'selected' functionality. + assert widgets['Share with:'].selected == "Private" + widgets['Share with:'].selected = "My Neighborhood" + assert widgets['Share with:'].selected == "My Neighborhood" + + # Test widget fetching/assignment + one = widgets['1'] + plus = widgets['+'] + enter = widgets['enter'] + + for i in range(0,5): + # Test click + one.click() + plus.click() + one.click() + + # Test Entry text assignment + assert widgets['TextEntry'].text == '1+1' + + enter.click() + + assert len(widgets['TextEntry'].text) == 0 + + time.sleep(1) + + # More Entry text assignment + widgets['TextEntry'].text = "1+5" + assert widgets['TextEntry'].text == '1+5' + enter.click() -- cgit v0.9.1