/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/tests/fixtures.py

  • Committer: Ubuntu One Auto Copilot
  • Author(s): Jelmer Vernooij
  • Date: 2022-08-30 10:28:23 UTC
  • mfrom: (533.1.1 trunk)
  • Revision ID: otto-copilot@canonical.com-20220830102823-u3w6efosxw5s086s
Cope with moved errors NoSuchFile and FileExists in newer versions of Breezy.

Merged from https://code.launchpad.net/~jelmer/loggerhead/moved-errors/+merge/429073

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2007, 2008, 2009, 2011 Canonical Ltd.
 
2
#
 
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.
 
7
#
 
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.
 
12
#
 
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
 
16
 
 
17
from __future__ import absolute_import
 
18
 
 
19
from fixtures import Fixture
 
20
 
 
21
 
 
22
class SampleBranch(Fixture):
 
23
 
 
24
    def __init__(self, testcase):
 
25
        # Must be a bzr TestCase to hook into branch creation, unfortunately.
 
26
        self.testcase = testcase
 
27
 
 
28
    def setUp(self):
 
29
        Fixture.setUp(self)
 
30
 
 
31
        self.tree = self.testcase.make_branch_and_tree('.')
 
32
 
 
33
        self.filecontents = (
 
34
            'some\nmultiline\ndata\n'
 
35
            'with<htmlspecialchars\n')
 
36
        filenames = ['myfilename', 'anotherfile<']
 
37
        self.testcase.build_tree_contents(
 
38
            (filename, self.filecontents) for filename in filenames)
 
39
        self.tree.add(filenames)
 
40
        self.path = 'myfilename'
 
41
        self.msg = 'a very exciting commit message <'
 
42
        self.revid = self.tree.commit(message=self.msg)