/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_commit.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import os
19
19
 
20
20
import breezy
21
 
from breezy import (
 
21
from .. import (
22
22
    config,
23
23
    controldir,
24
24
    errors,
25
25
    )
26
 
from breezy.branch import Branch
27
 
from breezy.bzrdir import BzrDirMetaFormat1
28
 
from breezy.commit import Commit, NullCommitReporter
29
 
from breezy.errors import (
 
26
from ..branch import Branch
 
27
from ..bzrdir import BzrDirMetaFormat1
 
28
from ..commit import Commit, NullCommitReporter
 
29
from ..errors import (
30
30
    PointlessCommit,
31
31
    BzrError,
32
32
    SigningFailed,
33
33
    LockContention,
34
34
    )
35
 
from breezy.tests import (
 
35
from . import (
36
36
    TestCaseWithTransport,
37
37
    test_foreign,
38
38
    )
39
 
from breezy.tests.features import (
 
39
from .features import (
40
40
    SymlinkFeature,
41
41
    )
42
 
from breezy.tests.matchers import MatchesAncestry
 
42
from .matchers import MatchesAncestry
43
43
 
44
44
 
45
45
# TODO: Test commit with some added, and added-but-missing files
377
377
 
378
378
    def test_strict_commit(self):
379
379
        """Try and commit with unknown files and strict = True, should fail."""
380
 
        from breezy.errors import StrictCommitFailed
 
380
        from ..errors import StrictCommitFailed
381
381
        wt = self.make_branch_and_tree('.')
382
382
        b = wt.branch
383
383
        with file('hello', 'w') as f: f.write('hello world')
422
422
        wt.commit("base", allow_pointless=True, rev_id='A')
423
423
        self.assertFalse(branch.repository.has_signature_for_revision_id('A'))
424
424
        try:
425
 
            from breezy.testament import Testament
 
425
            from ..testament import Testament
426
426
            # monkey patch gpg signing mechanism
427
427
            breezy.gpg.GPGStrategy = breezy.gpg.LoopbackGPGStrategy
428
428
            conf = config.MemoryStack('''
589
589
        this_tree.merge_from_branch(other_tree.branch)
590
590
        reporter = CapturingReporter()
591
591
        this_tree.commit('do the commit', reporter=reporter)
592
 
        expected = set([
 
592
        expected = {
593
593
            ('change', 'modified', 'filetomodify'),
594
594
            ('change', 'added', 'newdir'),
595
595
            ('change', 'added', 'newfile'),
599
599
            ('renamed', 'renamed', 'filetoreparent', 'renameddir/reparentedfile'),
600
600
            ('deleted', 'dirtoremove'),
601
601
            ('deleted', 'filetoremove'),
602
 
            ])
 
602
            }
603
603
        result = set(reporter.calls)
604
604
        missing = expected - result
605
605
        new = result - expected
720
720
        tree = self.make_branch_and_tree('.')
721
721
        try:
722
722
            tree.commit()
723
 
        except Exception, e:
 
723
        except Exception as e:
724
724
            self.assertTrue(isinstance(e, BzrError))
725
725
            self.assertEqual('The message or message_callback keyword'
726
726
                             ' parameter is required for commit().', str(e))