# HG changeset patch # User waltercruz # Date 1204235987 10800 # Node ID f625999d7c098042bee565777a62e57bf111b8b9 Beginning of the project diff -r 000000000000 -r f625999d7c09 notify_test.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notify_test.py Thu Feb 28 18:59:47 2008 -0300 @@ -0,0 +1,39 @@ +import sys +from nose.plugins.base import Plugin + +from StringIO import StringIO + +import pygtk +pygtk.require('2.0') +import pynotify +from new import instancemethod + +def writeln(self,*args): + for i in args: + self.write(i) + self.write("\n") + +class NotifyPlugin(Plugin): + + enabled = True + score = 1000 + name = "NotifyPlugin" + + def __init__(self): + self.stdout = [] + self._buf = StringIO() + self._buf.writeln = instancemethod(writeln,self._buf,StringIO) + + def configure(self, options, conf): + pass + + def options(self, parser, env): + pass + + def finalize(self, result): + result.stream = self._buf + result.printSummary(0,2) + pynotify.init("Basics") + n = pynotify.Notification("Tests", self._buf.getvalue()) + n.show() + return None \ No newline at end of file diff -r 000000000000 -r f625999d7c09 run_nose.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run_nose.py Thu Feb 28 18:59:47 2008 -0300 @@ -0,0 +1,5 @@ +import unittest +from nose.plugins.plugintest import run +from notify_test import NotifyPlugin + +run(suite=unittest.TestSuite(tests=[]),plugins=[NotifyPlugin()]) \ No newline at end of file