220
220
request.execute, backing.local_abspath('checkout'))
223
class TestSmartServerBranchRequestLastRevisionInfo(tests.TestCaseWithTransport):
225
def test_empty(self):
226
"""For an empty branch, the result is ('ok', '0', '')."""
227
backing = self.get_transport()
228
request = smart.branch.SmartServerBranchRequestLastRevisionInfo(backing)
229
self.make_branch('.')
230
self.assertEqual(SmartServerResponse(('ok', '0', '')),
231
request.execute(backing.local_abspath('')))
233
def test_not_empty(self):
234
"""For a non-empty branch, the result is ('ok', 'revno', 'revid')."""
235
backing = self.get_transport()
236
request = smart.branch.SmartServerBranchRequestLastRevisionInfo(backing)
237
tree = self.make_branch_and_memory_tree('.')
240
r1 = tree.commit('1st commit')
241
r2 = tree.commit('2nd commit', rev_id=u'\xc8')
244
SmartServerResponse(('ok', '2', u'\xc8'.encode('utf8'))),
245
request.execute(backing.local_abspath('')))
223
248
class TestHandlers(tests.TestCase):
224
249
"""Tests for the request.request_handlers object."""