~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_treebuilder.py

  • Committer: Andrew Bennetts
  • Date: 2008-05-21 02:34:32 UTC
  • mto: (3452.2.9 inter-remote-pack)
  • mto: This revision was merged to the branch mainline in revision 3452.
  • Revision ID: andrew.bennetts@canonical.com-20080521023432-rj4qn81st9sou7np
Buffer encoding of v3 messages to minimise write/send calls.  Doubles the speed of pushing over TCP with 500ms latency loopback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
"""Tests for the TreeBuilder helper class."""
19
19
 
37
37
 
38
38
 
39
39
class TestFakeTree(TestCaseWithTransport):
40
 
 
 
40
    
41
41
    def testFakeTree(self):
42
42
        """Check that FakeTree works as required for the TreeBuilder tests."""
43
43
        tree = FakeTree()
49
49
 
50
50
 
51
51
class TestTreeBuilderMemoryTree(tests.TestCaseWithMemoryTransport):
52
 
 
 
52
    
53
53
    def test_create(self):
54
54
        builder = TreeBuilder()
55
55
 
64
64
        tree = FakeTree()
65
65
        builder.start_tree(tree)
66
66
        self.assertRaises(errors.AlreadyBuilding, builder.start_tree, tree)
67
 
 
 
67
        
68
68
    def test_finish_tree_not_started_errors(self):
69
69
        builder = TreeBuilder()
70
70
        self.assertRaises(errors.NotBuilding, builder.finish_tree)