36
37
def test_format_description(self):
37
38
self.assertIsInstance(self.repository_format.get_format_description(),
42
class ForeignRepositoryFactory(object):
43
"""Factory of repository for ForeignRepositoryTests."""
45
def make_repository(self, transport):
46
"""Create a new, valid, repository. May or may not contain
48
raise NotImplementedError(self.make_repository)
51
class ForeignRepositoryTests(TestCaseWithTransport):
52
"""Basic tests for foreign repository implementations.
54
These tests mainly make sure that the implementation covers the required
55
bits of the API and returns semi-reasonable values, that are
56
at least of the expected types and in the expected ranges.
58
repository_factory = None # Set to an instance of ForeignRepositoryFactory by the scenario
60
def make_repository(self):
61
return self.repository_factory.make_repository(self.get_transport())
63
def test_make_working_trees(self):
64
"""Test that Repository.make_working_trees() returns a boolean."""
65
repo = self.make_repository()
66
self.assertIsInstance(repo.make_working_trees(), bool)
68
def test_get_physical_lock_status(self):
69
"""Test that a new repository is not locked by default."""
70
repo = self.make_repository()
71
self.assertFalse(repo.get_physical_lock_status())
73
def test_is_shared(self):
74
"""Test that is_shared() returns a bool."""
75
repo = self.make_repository()
76
self.assertIsInstance(repo.is_shared(), bool)
78
def test_gather_stats(self):
79
"""Test that gather_stats() will at least return a dictionary
80
with the required keys."""
81
repo = self.make_repository()
82
stats = repo.gather_stats()
83
self.assertIsInstance(stats, dict)
84
self.assertTrue(stats.has_key("revisions"))