1
# Copyright (C) 2008 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
"""Tests for add_signature_text on a repository with external references."""
19
from bzrlib import errors
20
from bzrlib.tests.per_repository_reference import (
21
TestCaseWithExternalReferenceRepository,
25
class TestAddSignatureText(TestCaseWithExternalReferenceRepository):
27
def test_add_signature_text_goes_to_repo(self):
28
# adding a signature only writes to the repository add_signature_text
30
tree = self.make_branch_and_tree('sample')
31
revid = tree.commit('one')
32
inv = tree.branch.repository.get_inventory(revid)
33
base = self.make_repository('base')
34
repo = self.make_referring('referring', 'base')
37
repo.start_write_group()
39
rev = tree.branch.repository.get_revision(revid)
40
repo.add_revision(revid, rev, inv=inv)
41
repo.add_signature_text(revid, "text")
43
repo.abort_write_group()
46
repo.commit_write_group()
49
repo.get_signature_text(revid)
50
self.assertRaises(errors.NoSuchRevision, base.get_signature_text,