/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test_pyutils.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
16
16
 
17
 
"""Tests for bzrlib.pyutils."""
 
17
"""Tests for breezy.pyutils."""
18
18
 
19
 
from bzrlib import (
 
19
from breezy import (
20
20
    branch,
21
21
    tests,
22
22
    )
23
 
from bzrlib.pyutils import (
 
23
from breezy.pyutils import (
24
24
    calc_parent_name,
25
25
    get_named_object,
26
26
    )
34
34
        self.assertIs(sys, get_named_object('sys'))
35
35
 
36
36
    def test_dotted_module(self):
37
 
        self.assertIs(branch, get_named_object('bzrlib.branch'))
 
37
        self.assertIs(branch, get_named_object('breezy.branch'))
38
38
 
39
39
    def test_module_attr(self):
40
40
        self.assertIs(
41
 
            branch.Branch, get_named_object('bzrlib.branch', 'Branch'))
 
41
            branch.Branch, get_named_object('breezy.branch', 'Branch'))
42
42
 
43
43
    def test_dotted_attr(self):
44
44
        self.assertIs(
45
45
            branch.Branch.hooks,
46
 
            get_named_object('bzrlib.branch', 'Branch.hooks'))
 
46
            get_named_object('breezy.branch', 'Branch.hooks'))
47
47
 
48
48
    def test_package(self):
49
 
        # bzrlib.tests is a package, not simply a module
50
 
        self.assertIs(tests, get_named_object('bzrlib.tests'))
 
49
        # breezy.tests is a package, not simply a module
 
50
        self.assertIs(tests, get_named_object('breezy.tests'))
51
51
 
52
52
    def test_package_attr(self):
53
 
        # bzrlib.tests is a package, not simply a module
 
53
        # breezy.tests is a package, not simply a module
54
54
        self.assertIs(
55
 
            tests.TestCase, get_named_object('bzrlib.tests', 'TestCase'))
 
55
            tests.TestCase, get_named_object('breezy.tests', 'TestCase'))
56
56
 
57
57
    def test_import_error(self):
58
58
        self.assertRaises(ImportError, get_named_object, 'NO_SUCH_MODULE')