~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

  • Committer: Robert Collins
  • Date: 2009-02-20 03:28:07 UTC
  • mto: This revision was merged to the branch mainline in revision 4023.
  • Revision ID: robertc@robertcollins.net-20090220032807-9ezo43wv9boso5id
Create a verb for Repository.set_make_working_trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1054
1054
            SmartServerResponse(('yes',)), response)
1055
1055
 
1056
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
 
1057
1082
class TestSmartServerPackRepositoryAutopack(tests.TestCaseWithTransport):
1058
1083
 
1059
1084
    def make_repo_needing_autopacking(self, path='.'):