Exemplo n.º 1
0
    def test_configuration(self):

        with self.settings(SMS_MODEM_CLASS='nguru.apps.notifications.tests.'
                           'test_notification_request.ModemA'):
            available_modem = get_available_modem()
            self.assertIsInstance(available_modem, ModemA)
        with self.settings(SMS_MODEM_CLASS='nguru.apps.notifications.tests.'
                           'test_notification_request.ModemB'):
            available_modem = get_available_modem()
            self.assertIsInstance(available_modem, ModemB)
Exemplo n.º 2
0
    def handle(self, *args, **options):
        self.options = options

        modem = get_available_modem()
        logger.debug("Using modem %s", modem)
        signal(SIGINT, on_sigint)
        if self.options['count']:

            return self.show_counters()

        while self.options['run_forever'] and not _stop:
            self.send_messages(modem)

        logger.info("Exited")
Exemplo n.º 3
0
    def handle(self, *args, **options):
        self.options = options

        modem = get_available_modem()
        logger.debug("Using modem %s", modem)
        signal(SIGINT, on_sigint)
        if self.options['count']:

            return self.show_counters()

        while self.options['run_forever'] and not _stop:
            self.send_messages(modem)

        logger.info("Exited")