bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
2241.1.1
by Martin Pool
Change RepositoryFormat to use a Registry rather than ad-hoc dictionary |
1 |
# Copyright (C) 2006, 2007 Canonical Ltd
|
|
1534.4.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
2 |
# Authors: Robert Collins <robert.collins@canonical.com>
|
|
2241.1.1
by Martin Pool
Change RepositoryFormat to use a Registry rather than ad-hoc dictionary |
3 |
# and others
|
|
1887.1.1
by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines, |
4 |
#
|
|
1534.4.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
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.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
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.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
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 |
||
|
1904.2.5
by Martin Pool
Fix format warning inside test suite and add test |
20 |
"""Repository implementation tests for bzr.
|
|
1534.4.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
21 |
|
22 |
These test the conformance of all the repository variations to the expected API.
|
|
23 |
Specific tests for individual formats are in the tests/test_repository.py file
|
|
24 |
rather than in tests/branch_implementations/*.py.
|
|
25 |
"""
|
|
26 |
||
|
2241.1.2
by Martin Pool
change to using external Repository format registry |
27 |
from bzrlib import ( |
28 |
repository, |
|
29 |
)
|
|
|
2241.1.4
by Martin Pool
Moved old weave-based repository formats into bzrlib.repofmt.weaverepo. |
30 |
from bzrlib.repository import ( |
31 |
RepositoryTestProviderAdapter, |
|
32 |
)
|
|
33 |
from bzrlib.repofmt import ( |
|
34 |
weaverepo, |
|
35 |
)
|
|
|
1534.4.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
36 |
from bzrlib.tests import ( |
37 |
adapt_modules, |
|
38 |
default_transport, |
|
39 |
TestLoader, |
|
40 |
TestSuite, |
|
41 |
)
|
|
|
2485.7.1
by Robert Collins
Relocate TestCaseWithRepository to be more central. |
42 |
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir |
|
2018.5.66
by Wouter van Heyst
Fix repository test parameterization for RemoteRepository. |
43 |
from bzrlib.transport.memory import MemoryServer |
|
1534.4.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
44 |
|
45 |
||
|
2485.7.1
by Robert Collins
Relocate TestCaseWithRepository to be more central. |
46 |
class TestCaseWithRepository(TestCaseWithBzrDir): |
47 |
||
48 |
def make_repository(self, relpath, format=None): |
|
49 |
if format is None: |
|
50 |
# Create a repository of the type we are trying to test.
|
|
51 |
made_control = self.make_bzrdir(relpath) |
|
52 |
return self.repository_format.initialize(made_control) |
|
53 |
else: |
|
54 |
return super(TestCaseWithRepository, self).make_repository( |
|
55 |
relpath, format) |
|
56 |
||
57 |
||
58 |
||
|
1534.4.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
59 |
def test_suite(): |
60 |
result = TestSuite() |
|
61 |
test_repository_implementations = [ |
|
|
1687.1.7
by Robert Collins
Teach Repository about break_lock. |
62 |
'bzrlib.tests.repository_implementations.test_break_lock', |
|
1740.3.1
by Jelmer Vernooij
Introduce and use CommitBuilder objects. |
63 |
'bzrlib.tests.repository_implementations.test_commit_builder', |
|
1534.4.41
by Robert Collins
Branch now uses BzrDir reasonably sanely. |
64 |
'bzrlib.tests.repository_implementations.test_fileid_involved', |
|
2249.5.18
by John Arbash Meinel
Add tests for iter_reverse_revision_history |
65 |
'bzrlib.tests.repository_implementations.test_iter_reverse_revision_history', |
|
1570.1.2
by Robert Collins
Import bzrtools' 'fix' command as 'bzr reconcile.' |
66 |
'bzrlib.tests.repository_implementations.test_reconcile', |
|
1534.4.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
67 |
'bzrlib.tests.repository_implementations.test_repository', |
|
1913.1.1
by John Arbash Meinel
Fix bug #55783 |
68 |
'bzrlib.tests.repository_implementations.test_revision', |
|
2258.1.1
by Robert Collins
Move info branch statistics gathering into the repository to allow smart server optimisation (Robert Collins). |
69 |
'bzrlib.tests.repository_implementations.test_statistics', |
|
1534.4.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
70 |
]
|
|
1752.2.31
by Martin Pool
[broken] some support for write operations over hpss |
71 |
|
|
2018.5.30
by Robert Collins
Reenable the stock repository implementations for testing. |
72 |
from bzrlib.smart.server import ( |
73 |
SmartTCPServer_for_testing, |
|
74 |
ReadonlySmartTCPServer_for_testing, |
|
75 |
)
|
|
|
1752.2.31
by Martin Pool
[broken] some support for write operations over hpss |
76 |
from bzrlib.remote import RemoteBzrDirFormat, RemoteRepositoryFormat |
|
2018.5.30
by Robert Collins
Reenable the stock repository implementations for testing. |
77 |
|
|
2241.1.11
by Martin Pool
Get rid of RepositoryFormat*_instance objects. Instead the format |
78 |
registry = repository.format_registry |
79 |
all_formats = [registry.get(k) for k in registry.keys()] |
|
|
2241.1.4
by Martin Pool
Moved old weave-based repository formats into bzrlib.repofmt.weaverepo. |
80 |
all_formats.extend(weaverepo._legacy_formats) |
|
2018.5.30
by Robert Collins
Reenable the stock repository implementations for testing. |
81 |
adapter = RepositoryTestProviderAdapter( |
82 |
default_transport, |
|
83 |
# None here will cause a readonly decorator to be created
|
|
84 |
# by the TestCaseWithTransport.get_readonly_transport method.
|
|
85 |
None, |
|
|
2241.1.1
by Martin Pool
Change RepositoryFormat to use a Registry rather than ad-hoc dictionary |
86 |
[(format, format._matchingbzrdir) for format in all_formats]) |
|
2018.5.30
by Robert Collins
Reenable the stock repository implementations for testing. |
87 |
loader = TestLoader() |
88 |
adapt_modules(test_repository_implementations, adapter, loader, result) |
|
89 |
||
90 |
adapt_to_smart_server = RepositoryTestProviderAdapter( |
|
91 |
SmartTCPServer_for_testing, |
|
92 |
ReadonlySmartTCPServer_for_testing, |
|
|
2018.5.66
by Wouter van Heyst
Fix repository test parameterization for RemoteRepository. |
93 |
[(RemoteRepositoryFormat(), RemoteBzrDirFormat())], |
94 |
MemoryServer
|
|
95 |
)
|
|
|
1752.2.31
by Martin Pool
[broken] some support for write operations over hpss |
96 |
adapt_modules(test_repository_implementations, |
|
2018.5.30
by Robert Collins
Reenable the stock repository implementations for testing. |
97 |
adapt_to_smart_server, |
98 |
loader, |
|
99 |
result) |
|
|
1752.2.33
by Martin Pool
[broken] more hpss methods and adapt to bzrdir tests |
100 |
|
|
1534.4.40
by Robert Collins
Add RepositoryFormats and allow bzrdir.open or create _repository to be used. |
101 |
return result |