Did I find the right examples for you? yes no

All Samples(5)  |  Call(4)  |  Derive(0)  |  Import(1)
Allows running of Queue Processor from the console.

src/z/o/zope.sendmail-4.0.0a2/src/zope/sendmail/tests/test_queue.py   zope.sendmail(Download)
from unittest import TestCase, TestSuite, makeSuite, main
 
from zope.sendmail.queue import ConsoleApp
from zope.sendmail.tests.test_delivery import MaildirStub, LoggerStub, \
    BrokenMailerStub, SMTPResponseExceptionMailerStub, MailerStub
    def test_args_processing(self):
        # simplest case that works
        cmdline = "zope-sendmail %s" % self.dir
        app = ConsoleApp(cmdline.split(), verbose=False)
        self.assertEquals("zope-sendmail", app.script_name)
            "--username chris --password rossi --force-tls " \
            "%s" % self.dir
        app = ConsoleApp(cmdline.split(), verbose=False)
        self.assertEquals("zope-sendmail", app.script_name)
        self.assertEquals(self.dir, app.queue_path)
        # override most everything
        cmdline = """zope-sendmail --config %s""" % ini_path
        app = ConsoleApp(cmdline.split(), verbose=False)
        self.assertEquals("zope-sendmail", app.script_name)
        self.assertEquals("hammer/dont/hurt/em", app.queue_path)
            f.write("[app:zope-sendmail]\n\nqueue_path=foo\n")
        cmdline = """zope-sendmail --config %s %s""" % (ini_path, self.dir)
        app = ConsoleApp(cmdline.split(), verbose=False)
        self.assertEquals("zope-sendmail", app.script_name)
        self.assertEquals(self.dir, app.queue_path)