1
# Copyright (C) 2006 Canonical Ltd
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
3
"""Tests for revision properties."""
19
from bzrlib.tests.repository_implementations.test_repository import (
20
TestCaseWithRepository,
5
from bzrlib.tests import TestCaseWithTransport
23
class TestRevProps(TestCaseWithRepository):
7
class TestRevProps(TestCaseWithTransport):
25
9
def test_simple_revprops(self):
26
10
"""Simple revision properties"""
27
11
wt = self.make_branch_and_tree('.')
29
13
b.nick = 'Nicholas'
30
props = dict(flavor='choc-mint',
31
condiment='orange\n mint\n\tcandy',
14
props = dict(flavor='choc-mint',
15
condiment='orange\n mint\n\tcandy')
34
16
wt.commit(message='initial null commit',
36
18
allow_pointless=True,
38
20
rev = b.repository.get_revision('test@user-1')
39
21
self.assertTrue('flavor' in rev.properties)
40
22
self.assertEquals(rev.properties['flavor'], 'choc-mint')
41
self.assertEquals([('branch-nick', 'Nicholas'),
23
self.assertEquals(sorted(rev.properties.items()),
24
[('branch-nick', 'Nicholas'),
42
25
('condiment', 'orange\n mint\n\tcandy'),
44
('flavor', 'choc-mint'),
45
('non_ascii', u'\xb5'),
46
], sorted(rev.properties.items()))
26
('flavor', 'choc-mint')])
48
28
def test_invalid_revprops(self):
49
29
"""Invalid revision properties"""