
import testtools

from talons import helpers

from tests import base


class TestHelpers(base.TestCase):

    def test_bad_import(self):
        with testtools.ExpectedException(ImportError):
            helpers.import_function('not.exist.function')

    def test_no_function_in_module(self):
        with testtools.ExpectedException(ImportError):
            helpers.import_function('sys.noexisting')

    def test_not_callable(self):
        with testtools.ExpectedException(TypeError):
            helpers.import_function('sys.stdout')


import testtools

from talons import helpers

from tests import base


class TestHelpers(base.TestCase):

    def test_bad_import(self):
        with testtools.ExpectedException(ImportError):
            helpers.import_function('not.exist.function')

    def test_no_function_in_module(self):
        with testtools.ExpectedException(ImportError):
            helpers.import_function('sys.noexisting')

    def test_not_callable(self):
        with testtools.ExpectedException(TypeError):
            helpers.import_function('sys.stdout')

    def test_return_function(self):
        fn = helpers.import_function('os.path.join')
        self.assertEqual(callable(fn), True)

Add test to ensure talons.helpers.import_function returns a callable
Add test to ensure talons.helpers.import_function returns a callable

  
  import testtools
  
  from talons import helpers
  
  from tests import base
  
  
  class TestHelpers(base.TestCase):
  
      def test_bad_import(self):
          with testtools.ExpectedException(ImportError):
              helpers.import_function('not.exist.function')
  
      def test_no_function_in_module(self):
          with testtools.ExpectedException(ImportError):
              helpers.import_function('sys.noexisting')
  
      def test_not_callable(self):
          with testtools.ExpectedException(TypeError):
              helpers.import_function('sys.stdout')
  
+     def test_return_function(self):
+         fn = helpers.import_function('os.path.join')
+         self.assertEqual(callable(fn), True)
+ 
Add test to ensure talons.helpers.import_function returns a callable
## Code Before:

import testtools

from talons import helpers

from tests import base


class TestHelpers(base.TestCase):

    def test_bad_import(self):
        with testtools.ExpectedException(ImportError):
            helpers.import_function('not.exist.function')

    def test_no_function_in_module(self):
        with testtools.ExpectedException(ImportError):
            helpers.import_function('sys.noexisting')

    def test_not_callable(self):
        with testtools.ExpectedException(TypeError):
            helpers.import_function('sys.stdout')

## Instruction:
Add test to ensure talons.helpers.import_function returns a callable
## Code After:

import testtools

from talons import helpers

from tests import base


class TestHelpers(base.TestCase):

    def test_bad_import(self):
        with testtools.ExpectedException(ImportError):
            helpers.import_function('not.exist.function')

    def test_no_function_in_module(self):
        with testtools.ExpectedException(ImportError):
            helpers.import_function('sys.noexisting')

    def test_not_callable(self):
        with testtools.ExpectedException(TypeError):
            helpers.import_function('sys.stdout')

    def test_return_function(self):
        fn = helpers.import_function('os.path.join')
        self.assertEqual(callable(fn), True)
