1
# -*- coding: iso-8859-1 -*-
3
# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
6
# This software may be used and distributed according to the terms
7
# of the GNU General Public License, incorporated herein by reference.
12
from bzrlib import bzrdir, osutils
13
from bzrlib.tests import treeshape
14
from trac import versioncontrol
16
from tracbzr import tests
18
class TestRepository(tests.SingleBranchTracTestCase):
20
def test_get_changeset(self):
21
self.assertRaises(versioncontrol.NoSuchChangeset,
22
self.trac_repo().get_changeset, 'foo')
23
self.assertRaises(versioncontrol.NoSuchChangeset,
24
self.trac_repo().get_changeset, ',foo')
25
revision_id = self.commit_foo_bar()
26
assert revision_id is not None
27
changeset = self.trac_repo().get_changeset(revision_id)
28
changeset = self.trac_repo().get_changeset("1")
30
def commit_foo_bar(self):
31
"""Create a simple revision"""
32
treeshape.build_tree_contents([('a/',), ('a/b',
34
self.tree.add(['a', 'a/b'])
35
return self.tree.commit('tree contents', rev_id='foo%bar')