Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8e1ebe155f
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (18 sloc) 0.67 kb
import smtplib
import xml.dom
import unittest
from nose.tools import eq_, raises
from funfactory.manage import import_mod_by_name
class TestImporter(unittest.TestCase):
def test_single_mod(self):
eq_(import_mod_by_name('smtplib'), smtplib)
def test_mod_attr(self):
eq_(import_mod_by_name('smtplib.SMTP'), smtplib.SMTP)
def test_multiple_attrs(self):
eq_(import_mod_by_name('smtplib.SMTP.connect'),
smtplib.SMTP.connect)
def test_multiple_mods(self):
eq_(import_mod_by_name('xml.dom'), xml.dom)
@raises(ImportError)
def test_unknown_mod(self):
import_mod_by_name('notthenameofamodule')
Jump to Line
Something went wrong with that request. Please try again.