~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revprops.py

[merge] land Robert's branch-formats branch

Show diffs side-by-side

added added

removed removed

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