summaryrefslogtreecommitdiffstats
path: root/funcweb/funcweb/tests
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-06-30 16:42:07 +0300
committermakkalot <makkalot@gmail.com>2008-06-30 16:42:07 +0300
commit26c404a846af78132e75a372f8662a4625522e28 (patch)
tree475477c581c5172bc81b439760efd629b033f4d7 /funcweb/funcweb/tests
parent2be806e517880542d2d33eb733846c741ca70b1b (diff)
downloadfunc-26c404a846af78132e75a372f8662a4625522e28.tar.gz
func-26c404a846af78132e75a372f8662a4625522e28.tar.xz
func-26c404a846af78132e75a372f8662a4625522e28.zip
as im going to export other methods in other modules i will need some remote testing renderer,so that will do the job for now
Diffstat (limited to 'funcweb/funcweb/tests')
-rw-r--r--funcweb/funcweb/tests/test_client_rendering.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/funcweb/funcweb/tests/test_client_rendering.py b/funcweb/funcweb/tests/test_client_rendering.py
new file mode 100644
index 0000000..f457da3
--- /dev/null
+++ b/funcweb/funcweb/tests/test_client_rendering.py
@@ -0,0 +1,45 @@
+from funcweb.widget_validation import WidgetSchemaFactory
+from funcweb.widget_automation import WidgetListFactory,RemoteFormAutomation,RemoteFormFactory
+from func.overlord.client import Overlord, Minions
+import socket
+import func.utils
+
+class TestClientWidgetRender(object):
+ minion = None
+
+ def test_all_minions(self):
+ minions =Minions("*").get_all_hosts()
+ for m in minions:
+ self.minion = m
+ self.remote_widget_render()
+
+ def remote_widget_render(self):
+ print "\n******testing minion : %s**********"%(self.minion)
+ fc = Overlord(self.minion)
+ modules = fc.system.list_modules()
+ display_modules={}
+
+ print "Getting the modules that has exported arguments"
+ for module in modules.itervalues():
+ for mod in module:
+ #if it is not empty
+ exported_methods = getattr(fc,mod).get_method_args()[self.minion]
+ if exported_methods:
+ print "%s will be rendered"%(mod)
+ display_modules[mod]=exported_methods
+
+ #do the rendering work here
+ for module,exp_meths in display_modules.iteritems():
+ for method_name,other_options in exp_meths.iteritems():
+ minion_arguments = other_options['args']
+ if minion_arguments:
+ wlist_object = WidgetListFactory(minion_arguments,minion=self.minion,module=module,method=method_name)
+ wlist_object = wlist_object.get_widgetlist_object()
+ #print wlist_object
+ wf = WidgetSchemaFactory(minion_arguments)
+ schema_man=wf.get_ready_schema()
+ minion_form = RemoteFormAutomation(wlist_object,schema_man)
+ print "%s.%s.%s rendered"%(self.minion,module,method_name)
+
+
+