~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-17 11:09:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6280.
  • Revision ID: jelmer@samba.org-20111117110931-qfpxsemxhmvgj7p5
Add HPSS call for BzrDir.has_workingtree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
        self.assertEqual(expected, request.execute('', 'False'))
222
222
 
223
223
 
 
224
class TestSmartServerBzrDirRequestHasWorkingTree(
 
225
    tests.TestCaseWithTransport):
 
226
    """Tests for BzrDir.has_workingtree."""
 
227
 
 
228
    def test_has_workingtree_yes(self):
 
229
        """A working tree is present."""
 
230
        backing = self.get_transport()
 
231
        dir = self.make_branch_and_tree('.').bzrdir
 
232
        request_class = smart_dir.SmartServerBzrDirRequestHasWorkingTree
 
233
        request = request_class(backing)
 
234
        expected = smart_req.SuccessfulSmartServerResponse(('yes',))
 
235
        self.assertEqual(expected, request.execute(''))
 
236
 
 
237
    def test_has_workingtree_no(self):
 
238
        """A working tree is missing."""
 
239
        backing = self.get_transport()
 
240
        dir = self.make_bzrdir('.')
 
241
        request_class = smart_dir.SmartServerBzrDirRequestHasWorkingTree
 
242
        request = request_class(backing)
 
243
        expected = smart_req.SuccessfulSmartServerResponse(('no',))
 
244
        self.assertEqual(expected, request.execute(''))
 
245
 
 
246
 
224
247
class TestSmartServerRequestCreateRepository(tests.TestCaseWithMemoryTransport):
225
248
    """Tests for BzrDir.create_repository."""
226
249