~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevprops.py

Handled more pipe errors for display commands.

Show diffs side-by-side

added added

removed removed

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