/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 bzrlib/tests/test_revprops.py

  • Committer: Michael Ellerman
  • Date: 2006-03-09 00:24:48 UTC
  • mto: (1610.1.8 bzr.mbp.integration)
  • mto: This revision was merged to the branch mainline in revision 1616.
  • Revision ID: michael@ellerman.id.au-20060309002448-70cce15e3d605130
Make the "ignore line" in the commit message editor the "right" width, so
that if you make your message that wide it won't wrap in bzr log output.
Just as a visual aid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# (C) 2005 Canonical
 
2
 
 
3
"""Tests for revision properties."""
 
4
 
 
5
from bzrlib.tests import TestCaseWithTransport
 
6
 
 
7
class TestRevProps(TestCaseWithTransport):
 
8
 
 
9
    def test_simple_revprops(self):
 
10
        """Simple revision properties"""
 
11
        wt = self.make_branch_and_tree('.')
 
12
        b = wt.branch
 
13
        b.nick = 'Nicholas'
 
14
        props = dict(flavor='choc-mint', 
 
15
                     condiment='orange\n  mint\n\tcandy')
 
16
        wt.commit(message='initial null commit', 
 
17
                 revprops=props,
 
18
                 allow_pointless=True,
 
19
                 rev_id='test@user-1')
 
20
        rev = b.repository.get_revision('test@user-1')
 
21
        self.assertTrue('flavor' in rev.properties)
 
22
        self.assertEquals(rev.properties['flavor'], 'choc-mint')
 
23
        self.assertEquals(sorted(rev.properties.items()),
 
24
                          [('branch-nick', 'Nicholas'), 
 
25
                           ('condiment', 'orange\n  mint\n\tcandy'),
 
26
                           ('flavor', 'choc-mint')])
 
27
 
 
28
    def test_invalid_revprops(self):
 
29
        """Invalid revision properties"""
 
30
        wt = self.make_branch_and_tree('.')
 
31
        b = wt.branch
 
32
        self.assertRaises(ValueError,
 
33
                          wt.commit, 
 
34
                          message='invalid',
 
35
                          revprops={'what a silly property': 'fine'})
 
36
        self.assertRaises(ValueError,
 
37
                          wt.commit, 
 
38
                          message='invalid',
 
39
                          revprops=dict(number=13))