Changeset 117 for trunk/tests

Show
Ignore:
Timestamp:
11/16/08 08:11:41 (2 months ago)
Author:
fs
Message:

renamed providers to transports which reflects the real purpose better

Location:
trunk/tests
Files:
1 modified
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/tests/test_custom_transport_injection.py

    r108 r117  
    11#!/usr/bin/env python 
    22# -*- coding: UTF-8 -*- 
    3 '''Test the injection of custom TurboMail providers without setuptools.''' 
     3'''Test the injection of custom TurboMail transports without setuptools.''' 
    44 
    55import logging 
    66import unittest 
    77 
    8 from turbomail.api import Manager, Provider 
     8from turbomail.api import Manager, Transport 
    99from turbomail.control import interface 
    1010from turbomail.message import Message 
     
    1313 
    1414 
    15 class DummyProvider(Provider): 
     15class DummyTransport(Transport): 
    1616    def deliver(self, message): 
    1717        return True 
     
    2323 
    2424 
    25 class TestCustomProviderInjection(unittest.TestCase): 
    26     """Test the injection of custom TurboMail providers without setuptools.""" 
     25class TestCustomTransportInjection(unittest.TestCase): 
     26    """Test the injection of custom TurboMail transports without setuptools.""" 
    2727     
    2828    def setUp(self): 
    2929        self.manager = DummyManager() 
    30         self.provider = DummyProvider() 
     30        self.transport = DummyTransport() 
    3131        self.message = Message(author=("Author", "author@example.com"), 
    3232                               to=("Recipient", "recipient@example.com"), 
     
    3939        interface.config = {'mail.on': False} 
    4040     
    41     def test_provide_dict_with_additional_managers_and_providers_which_overrides_setuptools(self): 
     41    def test_provide_dict_with_additional_managers_and_transports_which_overrides_setuptools(self): 
    4242        interface.config.update({'mail.manager': 'immediate', 
    43                                  'mail.provider': 'foo',}) 
    44         interface.start(extra_classes=dict(immediate=self.manager, foo=self.provider)) 
     43                                 'mail.transport': 'foo',}) 
     44        interface.start(extra_classes=dict(immediate=self.manager, foo=self.transport)) 
    4545        self.assertEqual(self.manager, interface.manager) 
    46         self.assertEqual(self.provider, interface.provider) 
     46        self.assertEqual(self.transport, interface.transport) 
    4747        interface.send(self.message) 
    4848     
  • trunk/tests/test_debug_transport.py

    r107 r117  
    11#!/usr/bin/env python 
    22# -*- coding: UTF-8 -*- 
    3 '''Test that the debug provider stores all "sent" mails.''' 
     3'''Test that the debug transport stores all "sent" mails.''' 
    44 
    55import unittest 
     
    88from turbomail.message import Message 
    99from turbomail.managers.immediate import ImmediateManager 
    10 from turbomail.providers.debug import DebugProviderFactory 
     10from turbomail.transports.debug import DebugTransportFactory 
    1111 
    12 class TestDebugProviderStoresAllMail(unittest.TestCase): 
     12class TestDebugTransportStoresAllMail(unittest.TestCase): 
    1313     
    1414    def setUp(self): 
    1515        interface.config = {'mail.on': True,  
    1616                            'mail.manager': 'immediate', 
    17                             'mail.provider': 'debug',} 
     17                            'mail.transport': 'debug',} 
    1818        # conciously using classes and instances for fake_setuptools so that 
    1919        # the test also checks that TurboMail will do the right thing. 
    2020        fake_setuptools =  {'immediate': ImmediateManager, 
    21                             'debug': DebugProviderFactory()} 
     21                            'debug': DebugTransportFactory()} 
    2222        interface.start(extra_classes=fake_setuptools) 
    2323        self.msg = Message('foo@example.com', 'to@example.com', 'Test',  
     
    3232        interface.send(self.msg) 
    3333         
    34         stored_mails = interface.manager.provider.get_sent_mails() 
     34        stored_mails = interface.manager.transport.get_sent_mails() 
    3535        self.assertEqual(1, len(stored_mails)) 
    3636        self.assertEqual(msg_string, str(stored_mails[0])) 
     
    4040        self.msg.send() 
    4141         
    42         stored_mails = interface.manager.provider.get_sent_mails() 
     42        stored_mails = interface.manager.transport.get_sent_mails() 
    4343        self.assertEqual(1, len(stored_mails)) 
    4444        self.assertEqual(msg_string, str(stored_mails[0])) 
  • trunk/tests/test_tm2_compatibility.py

    r113 r117  
    99from turbomail import Message, MailNotEnabledException 
    1010from turbomail.managers.immediate import ImmediateManager 
    11 from turbomail.providers.debug import DebugProviderFactory 
     11from turbomail.transports.debug import DebugTransportFactory 
    1212 
    1313class TestTurboMail2xCompatibility(unittest.TestCase): 
     
    5858        turbomail.control.interface.config = {'mail.on': True} 
    5959        fake_setuptools =  {'immediate': ImmediateManager, 
    60                             'debug': DebugProviderFactory} 
     60                            'debug': DebugTransportFactory} 
    6161        turbomail.control.interface.start(extra_classes=fake_setuptools) 
    6262