Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (20 sloc) 857 Bytes
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.Button import Button
from UnitTest import UnitTest
from pyjamas import DOM
class EventTest(UnitTest):
def onClick(self, sender):
self.assertTrue(sender == self.b)
self.buttonClickTestOccurred = True
def testButtonClick(self):
self.buttonClickTestOccurred = False
self.b = Button("Click Me", self)
# simulate button click
if not RootPanel('tests').remove(self.b):"Button added but apparently not owned by RootPanel()")
def lastTestChecks(self):
self.assertTrue(self.buttonClickTestOccurred, 'testButtonClick failed')
Jump to Line
Something went wrong with that request. Please try again.