Esempio n. 1
0
 def test_named_dispatch_map_should_invoke_filter_for_extensions(self):
     em = NameDispatchExtensionManager.make_test_instance(
         [test_extension, test_extension2])
     func = Mock()
     args = ('A', )
     kw = {'BIGGER': 'Cheese'}
     em.map(['test_extension'], func, *args, **kw)
     func.assert_called_once_with(test_extension, *args, **kw)
 def test_named_dispatch_map_should_invoke_filter_for_extensions(self):
     em = NameDispatchExtensionManager.make_test_instance([test_extension,
                                                           test_extension2])
     func = Mock()
     args = ('A',)
     kw = {'BIGGER': 'Cheese'}
     em.map(['test_extension'], func, *args, **kw)
     func.assert_called_once_with(test_extension, *args, **kw)
Esempio n. 3
0
 def test_name_dispatch_instance_should_build_extension_name_map(self):
     extensions = [test_extension, test_extension2]
     em = NameDispatchExtensionManager.make_test_instance(extensions)
     self.assertEqual(test_extension, em.by_name[test_extension.name])
     self.assertEqual(test_extension2, em.by_name[test_extension2.name])
Esempio n. 4
0
    def test_name_dispatch_instance_should_use_supplied_extensions(self):
        extensions = [test_extension, test_extension2]
        em = NameDispatchExtensionManager.make_test_instance(extensions)

        self.assertEqual(extensions, em.extensions)
 def test_name_dispatch_instance_should_build_extension_name_map(self):
     extensions = [test_extension, test_extension2]
     em = NameDispatchExtensionManager.make_test_instance(extensions)
     self.assertEqual(test_extension, em.by_name[test_extension.name])
     self.assertEqual(test_extension2, em.by_name[test_extension2.name])
    def test_name_dispatch_instance_should_use_supplied_extensions(self):
        extensions = [test_extension, test_extension2]
        em = NameDispatchExtensionManager.make_test_instance(extensions)

        self.assertEqual(extensions, em.extensions)
def test_name_dispatch_instance_should_build_extension_name_map():
    extensions = [test_extension, test_extension2]
    em = NameDispatchExtensionManager.make_test_instance(extensions)

    assert test_extension == em.by_name[test_extension.name]
    assert test_extension2 == em.by_name[test_extension2.name]
def test_name_dispatch_instance_should_use_supplied_extensions():
    extensions = [test_extension, test_extension2]
    em = NameDispatchExtensionManager.make_test_instance(extensions)

    assert extensions == em.extensions
def test_name_dispatch_instance_should_build_extension_name_map():
    extensions = [test_extension, test_extension2]
    em = NameDispatchExtensionManager.make_test_instance(extensions)

    assert test_extension == em.by_name[test_extension.name]
    assert test_extension2 == em.by_name[test_extension2.name]
def test_name_dispatch_instance_should_use_supplied_extensions():
    extensions = [test_extension, test_extension2]
    em = NameDispatchExtensionManager.make_test_instance(extensions)

    assert extensions == em.extensions