24
24
rather than in tests/revisionstore_implementations/*.py.
27
from bzrlib.store.revision import RevisionStoreTestProviderAdapter
29
27
from bzrlib.tests import (
36
class RevisionStoreTestProviderAdapter(TestScenarioApplier):
37
"""A tool to generate a suite testing multiple repository stores.
39
This is done by copying the test once for each repository store
40
and injecting the transport_server, transport_readonly_server,
41
and revision-store-factory into each copy.
42
Each copy is also given a new id() to make it easy to identify.
45
def __init__(self, transport_server, transport_readonly_server, factories):
46
self._transport_server = transport_server
47
self._transport_readonly_server = transport_readonly_server
48
self.scenarios = self.factories_to_scenarios(factories)
50
def factories_to_scenarios(self, factories):
51
"""Transform the input factories to a list of scenarios.
53
:param factories: A list of factories.
56
for factory in factories:
57
scenario = (factory, {
58
"transport_server":self._transport_server,
59
"transport_readonly_server":self._transport_readonly_server,
60
"store_factory":factory,
62
result.append(scenario)
66
def default_test_list():
67
"""Generate the default list of revision store permutations to test."""
68
from bzrlib.store.revision.text import TextRevisionStoreTestFactory
69
from bzrlib.store.revision.knit import KnitRevisionStoreFactory
71
# test the fallback InterVersionedFile from weave to annotated knits
72
result.append(TextRevisionStoreTestFactory())
73
result.append(KnitRevisionStoreFactory())
38
78
result = TestSuite()
39
79
test_revisionstore_implementations = [