/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

merge bzr.dev r4029

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
            request.transport_from_client_path('foo/').base)
161
161
 
162
162
 
 
163
class TestSmartServerRequestCreateRepository(tests.TestCaseWithMemoryTransport):
 
164
    """Tests for BzrDir.create_repository."""
 
165
 
 
166
    def test_makes_repository(self):
 
167
        """When there is a bzrdir present, the call succeeds."""
 
168
        backing = self.get_transport()
 
169
        self.make_bzrdir('.')
 
170
        request_class = bzrlib.smart.bzrdir.SmartServerRequestCreateRepository
 
171
        request = request_class(backing)
 
172
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
173
        reference_format = reference_bzrdir_format.repository_format
 
174
        network_name = reference_format.network_name()
 
175
        expected = SuccessfulSmartServerResponse(
 
176
            ('ok', 'no', 'no', 'no', network_name))
 
177
        self.assertEqual(expected, request.execute('', network_name, 'True'))
 
178
 
 
179
 
163
180
class TestSmartServerRequestFindRepository(tests.TestCaseWithMemoryTransport):
164
181
    """Tests for BzrDir.find_repository."""
165
182
 
1037
1054
            SmartServerResponse(('yes',)), response)
1038
1055
 
1039
1056
 
 
1057
class TestSmartServerRepositorySetMakeWorkingTrees(tests.TestCaseWithMemoryTransport):
 
1058
 
 
1059
    def test_set_false(self):
 
1060
        backing = self.get_transport()
 
1061
        repo = self.make_repository('.', shared=True)
 
1062
        repo.set_make_working_trees(True)
 
1063
        request_class = smart.repository.SmartServerRepositorySetMakeWorkingTrees
 
1064
        request = request_class(backing)
 
1065
        self.assertEqual(SuccessfulSmartServerResponse(('ok',)),
 
1066
            request.execute('', 'False'))
 
1067
        repo = repo.bzrdir.open_repository()
 
1068
        self.assertFalse(repo.make_working_trees())
 
1069
 
 
1070
    def test_set_true(self):
 
1071
        backing = self.get_transport()
 
1072
        repo = self.make_repository('.', shared=True)
 
1073
        repo.set_make_working_trees(False)
 
1074
        request_class = smart.repository.SmartServerRepositorySetMakeWorkingTrees
 
1075
        request = request_class(backing)
 
1076
        self.assertEqual(SuccessfulSmartServerResponse(('ok',)),
 
1077
            request.execute('', 'True'))
 
1078
        repo = repo.bzrdir.open_repository()
 
1079
        self.assertTrue(repo.make_working_trees())
 
1080
 
 
1081
 
1040
1082
class TestSmartServerPackRepositoryAutopack(tests.TestCaseWithTransport):
1041
1083
 
1042
1084
    def make_repo_needing_autopacking(self, path='.'):