14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
"""Tests for brzlib.pyutils."""
17
"""Tests for breezy.pyutils."""
23
from brzlib.pyutils import (
23
from breezy.pyutils import (
34
34
self.assertIs(sys, get_named_object('sys'))
36
36
def test_dotted_module(self):
37
self.assertIs(branch, get_named_object('brzlib.branch'))
37
self.assertIs(branch, get_named_object('breezy.branch'))
39
39
def test_module_attr(self):
41
branch.Branch, get_named_object('brzlib.branch', 'Branch'))
41
branch.Branch, get_named_object('breezy.branch', 'Branch'))
43
43
def test_dotted_attr(self):
45
45
branch.Branch.hooks,
46
get_named_object('brzlib.branch', 'Branch.hooks'))
46
get_named_object('breezy.branch', 'Branch.hooks'))
48
48
def test_package(self):
49
# brzlib.tests is a package, not simply a module
50
self.assertIs(tests, get_named_object('brzlib.tests'))
49
# breezy.tests is a package, not simply a module
50
self.assertIs(tests, get_named_object('breezy.tests'))
52
52
def test_package_attr(self):
53
# brzlib.tests is a package, not simply a module
53
# breezy.tests is a package, not simply a module
55
tests.TestCase, get_named_object('brzlib.tests', 'TestCase'))
55
tests.TestCase, get_named_object('breezy.tests', 'TestCase'))
57
57
def test_import_error(self):
58
58
self.assertRaises(ImportError, get_named_object, 'NO_SUCH_MODULE')