<commit_before>from rapidsms.router.test import BlockingRouter
from rapidsms.messages.outgoing import OutgoingMessage
from rapidsms.tests.harness import RapidTest, MockApp
from rapidsms.models import Connection


class RouterOutgoingPhases(RapidTest):

    apps = (MockApp,)

    def test_outgoing_phase(self):
        """App.outgoing should be called for sent messages."""
        self.send('test', self.lookup_connections('1112223333'))
        app = self.router.apps[0]
        self.assertTrue('outgoing' in app.calls)

    def test_process_outgoing_phases_return_value(self):
        """
        Returning False from App.outgoing should cause
        Router.process_outgoing_phases() to return False as well.
        """
        self.router.apps[0].return_values['outgoing'] = False<commit_msg>remove unused imports<commit_after>from rapidsms.models import Connection
from rapidsms.tests.harness import RapidTest, MockApp


class RouterOutgoingPhases(RapidTest):

    apps = (MockApp,)

    def test_outgoing_phase(self):
        """App.outgoing should be called for sent messages."""
        self.send('test', self.lookup_connections('1112223333'))
        app = self.router.apps[0]
        self.assertTrue('outgoing' in app.calls)

    def test_process_outgoing_phases_return_value(self):
        """
        Returning False from App.outgoing should cause
        Router.process_outgoing_phases() to return False as well.
        """
        self.router.apps[0].return_values['outgoing'] = False
{'fraction_non_alphanumeric': 0.09726848767488341, 'fraction_numerical': 0.015989340439706862, 'mean_word_length': 3.6215384615384614, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5034222', 'n_tokens_mistral': 458, 'n_tokens_neox': 431, 'n_words': 99}