[asterisk-commits] jpeeler: branch jpeeler/event_watcher r280 - /asterisk/team/jpeeler/event_wat...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 5 14:39:22 CDT 2010
Author: jpeeler
Date: Wed May 5 14:39:19 2010
New Revision: 280
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=280
Log:
whitespace cleanup
Modified:
asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py
asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test
Modified: asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py?view=diff&rev=280&r1=279&r2=280
==============================================================================
--- asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py (original)
+++ asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py Wed May 5 14:39:19 2010
@@ -26,7 +26,7 @@
self.asterisk.stop()
def clear_vars(self):
-
+
self.event_list = list()
self.count = 0
self.send_event_list = list()
@@ -197,10 +197,10 @@
if self.count == 0:
self.load_next_test(ami)
continue
-
+
def exec_next_test(self, count, toexec):
self.log.info("Next test count %s", count)
-
+
if not hasattr(self.testobj, toexec):
self.log.debug("No more tests")
return -1
@@ -216,7 +216,7 @@
self.log.debug("Rescheduling timeout")
self.call_id = reactor.callLater(self.timeout_sec, self.timeout)
return 0
-
+
self.log.warn("Returning, no events added by test method!")
return -1 # exception or something
Modified: asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test?view=diff&rev=280&r1=279&r2=280
==============================================================================
--- asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test (original)
+++ asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test Wed May 5 14:39:19 2010
@@ -49,7 +49,7 @@
watcher.add_event(event1)
event_send = {'Action' : 'ping'}
watcher.add_send_event(event_send)
-
+
#def test1(self, watcher):
# event1 = [{'response' : 'Success', 'ping' : 'Pong'}]
# watcher.add_event(event1)
@@ -65,24 +65,24 @@
#watcher.add_event(event2)
#watcher.add_event(event3)
#watcher.set_ordered(True)
-
+
#event1 = [{'event' : 'Alarm', 'channel' : '17' }]
#event2 = [{'event' : 'Alarm', 'channel' : '18' }]
#event3 = [{'event' : 'Alarm', 'channel' : '20' }, {'event' : 'Alarm', 'channel' : '19'}]
#watcher.add_event(event1)
#watcher.add_event(event2)
#watcher.add_event(event3)
-
+
# alternative event set up:
#watcher.set_events(False,
# [[{'event' : 'Alarm', 'channel' : '18' }],
# [{'event' : 'Alarm', 'channel' : '17' }],
# [{'event' : 'Alarm', 'channel' : '19' }, {'event' : 'Alarm', 'channel' : '20'}]])
#watcher.set_ordered(True)
-
+
def main():
logging.basicConfig()
-
+
watcher = client.EventWatcher()
tester = Test()
@@ -91,16 +91,16 @@
watcher.set_test_obj(tester)
watcher.set_timeout(5)
-
+
reactor.callWhenRunning(watcher.start)
reactor.run()
-
+
if watcher.passed:
watcher.log.info("All tests were good!")
return 0
watcher.log.error("Test failure")
return 1
-
+
if __name__ == "__main__":
sys.exit(main() or 0)
More information about the asterisk-commits
mailing list