3
"""Tests for revision properties."""
5
from bzrlib.tests import TestCaseWithTransport
7
class TestRevProps(TestCaseWithTransport):
9
def test_simple_revprops(self):
10
"""Simple revision properties"""
11
wt = self.make_branch_and_tree('.')
14
props = dict(flavor='choc-mint',
15
condiment='orange\n mint\n\tcandy')
16
wt.commit(message='initial null commit',
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')])
28
def test_invalid_revprops(self):
29
"""Invalid revision properties"""
30
wt = self.make_branch_and_tree('.')
32
self.assertRaises(ValueError,
35
revprops={'what a silly property': 'fine'})
36
self.assertRaises(ValueError,
39
revprops=dict(number=13))