234
234
adapter.scenarios)
237
class TestRepositoryProviderAdapter(TestCase):
237
class TestRepositoryParameterisation(TestCase):
238
238
"""A group of tests that test the repository implementation test adapter."""
240
def test_constructor(self):
241
# check that constructor parameters are passed through to the
243
from bzrlib.tests.repository_implementations import RepositoryTestProviderAdapter
246
formats = [("c", "C"), ("d", "D")]
247
adapter = RepositoryTestProviderAdapter(server1, server2, formats)
250
{'bzrdir_format': 'C',
251
'repository_format': 'c',
252
'transport_readonly_server': 'b',
253
'transport_server': 'a'}),
255
{'bzrdir_format': 'D',
256
'repository_format': 'd',
257
'transport_readonly_server': 'b',
258
'transport_server': 'a'})],
261
240
def test_setting_vfs_transport(self):
262
241
"""The vfs_transport_factory can be set optionally."""
263
from bzrlib.tests.repository_implementations import RepositoryTestProviderAdapter
264
formats = [("a", "b"), ("c", "d")]
265
adapter = RepositoryTestProviderAdapter(None, None, formats,
242
from bzrlib.tests.repository_implementations import formats_to_scenarios
243
scenarios = formats_to_scenarios(
244
[("a", "b"), ("c", "d")],
266
247
vfs_transport_factory="vfs")
267
248
self.assertEqual([
277
258
'transport_readonly_server': None,
278
259
'transport_server': None,
279
260
'vfs_transport_factory': 'vfs'})],
282
263
def test_formats_to_scenarios(self):
283
264
"""The adapter can generate all the scenarios needed."""
284
from bzrlib.tests.repository_implementations import RepositoryTestProviderAdapter
285
no_vfs_adapter = RepositoryTestProviderAdapter("server", "readonly",
287
vfs_adapter = RepositoryTestProviderAdapter("server", "readonly",
288
[], vfs_transport_factory="vfs")
265
from bzrlib.tests.repository_implementations import formats_to_scenarios
266
formats = [("c", "C"), (1, "D")]
267
no_vfs_scenarios = formats_to_scenarios(formats, "server", "readonly",
269
vfs_scenarios = formats_to_scenarios(formats, "server", "readonly",
270
vfs_transport_factory="vfs")
289
271
# no_vfs generate scenarios without vfs_transport_factor
290
formats = [("c", "C"), (1, "D")]
291
272
self.assertEqual([
293
274
{'bzrdir_format': 'C',
313
294
'transport_readonly_server': 'readonly',
314
295
'transport_server': 'server',
315
296
'vfs_transport_factory': 'vfs'})],
316
vfs_adapter.formats_to_scenarios(formats))
319
300
class TestTestScenarioApplier(TestCase):