~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-20 00:41:19 UTC
  • mto: This revision was merged to the branch mainline in revision 6318.
  • Revision ID: jelmer@samba.org-20111120004119-fzlqw19n4jzs3hps
Add Repository.iter_file_bytes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1597
1597
            request.execute('', rev_id_utf8))
1598
1598
 
1599
1599
 
 
1600
class TestSmartServerRepositoryIterFileBytes(tests.TestCaseWithTransport):
 
1601
 
 
1602
    def test_simple(self):
 
1603
        backing = self.get_transport()
 
1604
        request = smart_repo.SmartServerRepositoryIterFileBytes(backing)
 
1605
        t = self.make_branch_and_tree('.')
 
1606
        self.addCleanup(t.lock_write().unlock)
 
1607
        self.build_tree_contents([("file", "somecontents")])
 
1608
        t.add(["file"], ["thefileid"])
 
1609
        t.commit(rev_id='somerev', message="add file")
 
1610
        response = request.execute('', 'thefileid', 'somerev')
 
1611
        self.assertTrue(response.is_successful())
 
1612
        self.assertEquals(response.args, ("ok", ))
 
1613
        self.assertEquals("".join(response.body_stream), "somecontents")
 
1614
 
 
1615
 
1600
1616
class TestSmartServerRequestHasSignatureForRevisionId(
1601
1617
        tests.TestCaseWithMemoryTransport):
1602
1618
 
2049
2065
            smart_repo.SmartServerRepositoryInsertStreamLocked)
2050
2066
        self.assertHandlerEqual('Repository.is_shared',
2051
2067
            smart_repo.SmartServerRepositoryIsShared)
 
2068
        self.assertHandlerEqual('Repository.iter_file_bytes',
 
2069
            smart_repo.SmartServerRepositoryIterFileBytes)
2052
2070
        self.assertHandlerEqual('Repository.lock_write',
2053
2071
            smart_repo.SmartServerRepositoryLockWrite)
2054
2072
        self.assertHandlerEqual('Repository.make_working_trees',