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
3
17
"""Tests for revision properties."""
5
from bzrlib.tests import TestCaseWithTransport
19
from bzrlib.tests.repository_implementations.test_repository import (
20
TestCaseWithRepository,
7
class TestRevProps(TestCaseWithTransport):
23
class TestRevProps(TestCaseWithRepository):
9
25
def test_simple_revprops(self):
10
26
"""Simple revision properties"""
11
27
wt = self.make_branch_and_tree('.')
13
29
b.nick = 'Nicholas'
14
props = dict(flavor='choc-mint',
15
condiment='orange\n mint\n\tcandy')
30
props = dict(flavor='choc-mint',
31
condiment='orange\n mint\n\tcandy',
16
34
wt.commit(message='initial null commit',
18
36
allow_pointless=True,
20
38
rev = b.repository.get_revision('test@user-1')
21
39
self.assertTrue('flavor' in rev.properties)
22
40
self.assertEquals(rev.properties['flavor'], 'choc-mint')
23
self.assertEquals(sorted(rev.properties.items()),
24
[('branch-nick', 'Nicholas'),
41
self.assertEquals([('branch-nick', 'Nicholas'),
25
42
('condiment', 'orange\n mint\n\tcandy'),
26
('flavor', 'choc-mint')])
44
('flavor', 'choc-mint'),
45
('non_ascii', u'\xb5'),
46
], sorted(rev.properties.items()))
28
48
def test_invalid_revprops(self):
29
49
"""Invalid revision properties"""