/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
1534.4.46 by Robert Collins
Nearly complete .bzr/checkout splitout.
1
# Copyright (C) 2006 by Canonical Ltd
2
# Authors: Robert Collins <robert.collins@canonical.com>
3
# -*- coding: utf-8 -*-
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
4
#
1534.4.46 by Robert Collins
Nearly complete .bzr/checkout splitout.
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
9
#
1534.4.46 by Robert Collins
Nearly complete .bzr/checkout splitout.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
# GNU General Public License for more details.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
14
#
1534.4.46 by Robert Collins
Nearly complete .bzr/checkout splitout.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
20
"""WorkingTree implementation tests for bzr.
21
22
These test the conformance of all the workingtre variations to the expected API.
23
Specific tests for individual formats are in the tests/test_workingtree file 
24
rather than in tests/workingtree_implementations/*.py.
25
"""
26
1534.5.5 by Robert Collins
Move is_control_file into WorkingTree.is_control_filename and test.
27
import bzrlib.errors as errors
28
from bzrlib.transport import get_transport
1534.4.46 by Robert Collins
Nearly complete .bzr/checkout splitout.
29
from bzrlib.tests import (
30
                          adapt_modules,
31
                          default_transport,
32
                          TestLoader,
33
                          TestSuite,
34
                          )
1666.1.4 by Robert Collins
* 'Metadir' is now the default disk format. This improves behaviour in
35
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
1534.5.5 by Robert Collins
Move is_control_file into WorkingTree.is_control_filename and test.
36
from bzrlib.workingtree import (WorkingTreeFormat,
37
                                WorkingTreeTestProviderAdapter,
38
                                _legacy_formats,
39
                                )
40
41
1666.1.4 by Robert Collins
* 'Metadir' is now the default disk format. This improves behaviour in
42
class TestCaseWithWorkingTree(TestCaseWithBzrDir):
43
44
    def make_branch_and_tree(self, relpath, format=None):
45
        made_control = self.make_bzrdir(relpath, format=format)
1534.5.5 by Robert Collins
Move is_control_file into WorkingTree.is_control_filename and test.
46
        made_control.create_repository()
47
        made_control.create_branch()
48
        return self.workingtree_format.initialize(made_control)
1534.4.46 by Robert Collins
Nearly complete .bzr/checkout splitout.
49
50
51
def test_suite():
52
    result = TestSuite()
53
    test_workingtree_implementations = [
1666.1.4 by Robert Collins
* 'Metadir' is now the default disk format. This improves behaviour in
54
        'bzrlib.tests.workingtree_implementations.test_basis_inventory',
1687.1.9 by Robert Collins
Teach WorkingTree about break-lock.
55
        'bzrlib.tests.workingtree_implementations.test_break_lock',
1852.9.6 by Robert Collins
Merge the change from Tree.compare to Tree.changes_from.
56
        'bzrlib.tests.workingtree_implementations.test_changes_from',
1666.1.18 by Robert Collins
Add a progress bar during commit operations.
57
        'bzrlib.tests.workingtree_implementations.test_commit',
1711.4.30 by John Arbash Meinel
Don't peak under the covers, and test all working tree implementations for executable success (suggested by Robert Collins)
58
        'bzrlib.tests.workingtree_implementations.test_executable',
1773.2.1 by Robert Collins
Teach all trees about unknowns, conflicts and get_parent_ids.
59
        'bzrlib.tests.workingtree_implementations.test_get_parent_ids',
1534.5.5 by Robert Collins
Move is_control_file into WorkingTree.is_control_filename and test.
60
        'bzrlib.tests.workingtree_implementations.test_is_control_filename',
1713.2.1 by Robert Collins
Some tests for WorkingTree.is_ignored so it can be refactored with confidence.
61
        'bzrlib.tests.workingtree_implementations.test_is_ignored',
1711.8.5 by John Arbash Meinel
Move the new locking tests into their own files, and move the helper functions into a test helper.
62
        'bzrlib.tests.workingtree_implementations.test_locking',
1979.2.1 by Robert Collins
(robertc) adds a convenience method "merge_from_branch" to WorkingTree.
63
        'bzrlib.tests.workingtree_implementations.test_merge_from_branch',
1908.5.3 by Robert Collins
Rename the tree.set_parents tests to tree.parents - preparing to add related function tests. Also remove duplication within the tests by factoring out a helper assert.
64
        'bzrlib.tests.workingtree_implementations.test_parents',
1563.1.4 by Robert Collins
Fix 'bzr pull' on metadir trees.
65
        'bzrlib.tests.workingtree_implementations.test_pull',
1986.1.2 by Robert Collins
Various changes to allow non-workingtree specific tests to run entirely
66
        'bzrlib.tests.workingtree_implementations.test_put_file',
67
        'bzrlib.tests.workingtree_implementations.test_mkdir',
1534.4.46 by Robert Collins
Nearly complete .bzr/checkout splitout.
68
        'bzrlib.tests.workingtree_implementations.test_workingtree',
69
        ]
70
    adapter = WorkingTreeTestProviderAdapter(
71
        default_transport,
72
        # None here will cause a readonly decorator to be created
73
        # by the TestCaseWithTransport.get_readonly_transport method.
74
        None,
75
        [(format, format._matchingbzrdir) for format in 
76
         WorkingTreeFormat._formats.values() + _legacy_formats])
77
    loader = TestLoader()
78
    adapt_modules(test_workingtree_implementations, adapter, loader, result)
79
    return result