/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_pyutils.py

  • Committer: Breezy landing bot
  • Author(s): Colin Watson
  • Date: 2020-11-16 21:47:08 UTC
  • mfrom: (7521.1.1 remove-lp-workaround)
  • Revision ID: breezy.the.bot@gmail.com-20201116214708-jos209mgxi41oy15
Remove breezy.git workaround for bazaar.launchpad.net.

Merged from https://code.launchpad.net/~cjwatson/brz/remove-lp-workaround/+merge/393710

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')
62
62
            AttributeError, get_named_object, 'sys', 'NO_SUCH_ATTR')
63
63
 
64
64
 
65
 
 
66
65
class TestCalcParent_name(tests.TestCase):
67
66
    """Tests for calc_parent_name."""
68
67
 
85
84
        err = self.assertRaises(AssertionError, calc_parent_name, 'mod_name')
86
85
        self.assertEqual(
87
86
            "No parent object for top-level module 'mod_name'", err.args[0])
88