<s> import smtplib <EOL> import xml . dom <EOL> import unittest <EOL> from nose . tools import eq_ , raises <EOL> from funfactory . manage import import_mod_by_name <EOL> class TestImporter ( unittest . TestCase ) : <EOL> def test_single_mod ( self ) : <EOL> eq_ ( import_mod_by_name ( '<STR_LIT>' ) , smtplib ) <EOL> def test_mod_attr ( self ) : <EOL> eq_ ( import_mod_by_name ( '<STR_LIT>' ) , smtplib . SMTP ) <EOL> def test_multiple_attrs ( self ) : <EOL> eq_ ( import_mod_by_name ( '<STR_LIT>' ) , <EOL> smtplib . SMTP . connect ) <EOL> def test_multiple_mods ( self ) : <EOL> eq_ ( import_mod_by_name ( '<STR_LIT>' ) , xml . dom ) <EOL> @ raises ( ImportError ) <EOL> def test_unknown_mod ( self ) : <EOL> import_mod_by_name ( '<STR_LIT>' ) </s>
