~ubuntu-branches/debian/sid/trac-bzr/sid

« back to all changes in this revision

Viewing changes to tracbzr/tests/test_branch.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2008-08-01 18:03:14 UTC
  • mfrom: (1.1.1 upstream) (2.1.3 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080801180314-nokyxvypv0aaycnr
Tags: 0.2+bzr45-1
* New upstream snapshot.
 + Adds support for trac 0.11. (Closes: #490193)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: iso-8859-1 -*-
 
2
#
 
3
# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
 
4
# All rights reserved.
 
5
#
 
6
# This software may be used and distributed according to the terms
 
7
# of the GNU General Public License, incorporated herein by reference.
 
8
 
 
9
 
 
10
import urllib
 
11
 
 
12
from bzrlib import bzrdir, osutils
 
13
from bzrlib.tests import treeshape
 
14
from trac import versioncontrol
 
15
 
 
16
from tracbzr import tests
 
17
 
 
18
class TestRepository(tests.SingleBranchTracTestCase):
 
19
 
 
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")
 
29
 
 
30
    def commit_foo_bar(self):
 
31
        """Create a simple revision"""
 
32
        treeshape.build_tree_contents([('a/',), ('a/b', 
 
33
                                        'contents of b')])
 
34
        self.tree.add(['a', 'a/b'])
 
35
        return self.tree.commit('tree contents', rev_id='foo%bar')
 
36
 
 
37