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

« back to all changes in this revision

Viewing changes to .pc/01_test_isolation.diff/tracbzr/tests/test_branch.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-05-01 05:20:09 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20110501052009-s192c1t33hx9f7n4
Tags: 0.4.2+bzr117-1
* New upstream snapshot.
 + Drop 01_test_isolation.diff: Applied upstream.
* Add build dependency on python-bzrlib.tests, required for newer
  versions of bzr.

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("1")
28
 
        revision_id = urllib.quote(revision_id, '')
29
 
        changeset = self.trac_repo().get_changeset(revision_id)
30
 
 
31
 
    def commit_foo_bar(self):
32
 
        """Create a simple revision"""
33
 
        treeshape.build_tree_contents([('a/',), ('a/b', 
34
 
                                        'contents of b')])
35
 
        self.tree.add(['a', 'a/b'])
36
 
        return self.tree.commit('tree contents', rev_id='foo%bar')
37
 
 
38