~psivaa/tarmac/testing-jlp

« back to all changes in this revision

Viewing changes to tarmac/tests/test_branch.py

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2013-11-04 19:58:51 UTC
  • mfrom: (415.2.1 broken-author)
  • Revision ID: tarmac-20131104195851-b5njnd1hyia66q3s
Handle an AssertionError from bzrlib on commit, and add a test for it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib.errors import PointlessMerge
22
22
 
23
23
from tarmac import branch
24
 
from tarmac.tests import BranchTestCase
25
 
from tarmac.tests import MockLPBranch
 
24
from tarmac.exceptions import TarmacMergeError
 
25
from tarmac.tests import (
 
26
    BranchTestCase,
 
27
    MockLPBranch,
 
28
)
26
29
 
27
30
 
28
31
class TestBranch(BranchTestCase):
199
202
        self.assertEqual(sorted(self.branch1.unmanaged_files), expected)
200
203
        self.branch1.cleanup()
201
204
        self.assertEqual(self.branch1.unmanaged_files, [])
 
205
 
 
206
    def test_commit_with_author_with_newline(self):
 
207
        """Test that committing a branch with an author containing \n fails."""
 
208
        authors = ['author1', 'author2']
 
209
        self.assertRaises(TarmacMergeError,
 
210
                          self.branch2.commit,
 
211
                          'Authors Merge test', authors=['\n'.join(authors)])