/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_url_policy_open.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:
16
16
 
17
17
"""Tests for the branch open with specific URL policy code."""
18
18
 
19
 
from bzrlib import urlutils
20
 
from bzrlib.branch import (
 
19
from .. import urlutils
 
20
from ..branch import (
21
21
    Branch,
22
22
    BranchReferenceFormat,
23
23
    )
24
 
from bzrlib.bzrdir import (
 
24
from ..bzrdir import (
25
25
    BzrProber,
26
26
    )
27
 
from bzrlib.controldir import (
 
27
from ..controldir import (
28
28
    ControlDir,
29
29
    ControlDirFormat,
30
30
    )
31
 
from bzrlib.errors import NotBranchError
32
 
from bzrlib.url_policy_open import (
 
31
from ..errors import NotBranchError
 
32
from ..url_policy_open import (
33
33
    BadUrl,
34
34
    _BlacklistPolicy,
35
35
    BranchLoopError,
38
38
    BranchOpener,
39
39
    WhitelistPolicy,
40
40
    )
41
 
from bzrlib.tests import (
 
41
from . import (
42
42
    TestCase,
43
43
    TestCaseWithTransport,
44
44
    )
45
 
from bzrlib.transport import chroot
 
45
from ..transport import chroot
46
46
 
47
47
 
48
48
class TestBranchOpenerCheckAndFollowBranchReference(TestCase):
81
81
    def test_check_initial_url(self):
82
82
        # check_and_follow_branch_reference rejects all URLs that are not
83
83
        # allowed.
84
 
        opener = self.make_branch_opener(None, [], set(['a']))
 
84
        opener = self.make_branch_opener(None, [], {'a'})
85
85
        self.assertRaises(
86
86
            BadUrl, opener.check_and_follow_branch_reference, 'a')
87
87
 
288
288
            [a.base, b.base], probers=[TrackingProber])
289
289
        opener.open(b.base)
290
290
        self.assertEqual(
291
 
            set(TrackingProber.seen_urls), set([b.base, a.base]))
 
291
            set(TrackingProber.seen_urls), {b.base, a.base})
292
292
 
293
293
    def test_custom_opener_with_branch_reference(self):
294
294
        # A custom function for opening a control dir can be specified.
300
300
            [a.base, b.base], probers=[TrackingProber])
301
301
        opener.open(b.base)
302
302
        self.assertEqual(
303
 
            set(TrackingProber.seen_urls), set([b.base, a.base]))
 
303
            set(TrackingProber.seen_urls), {b.base, a.base})
304
304
 
305
305
 
306
306
class TestOpenOnlyScheme(TestCaseWithTransport):