~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_pack.py

  • Committer: Martin Packman
  • Date: 2011-12-19 10:37:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6394.
  • Revision ID: martin.packman@canonical.com-20111219103757-b85as9n9pb7e6qvn
Add tests for deprecated unicode wrapper functions in win32utils

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
    def _update_file(self, path, text, checkin=True):
40
40
        """append text to file 'path' and check it in"""
41
 
        open(path, 'a').write(text)
 
41
        with open(path, 'a') as f:
 
42
            f.write(text)
 
43
 
42
44
        if checkin:
43
45
            self.run_bzr(['ci', path, '-m', '"' + path + '"'])
44
46
 
81
83
 
82
84
        pack_names = transport.list_dir('repository/obsolete_packs')
83
85
        self.assertTrue(len(pack_names) == 0)
 
86
 
 
87
 
 
88
class TestSmartServerPack(tests.TestCaseWithTransport):
 
89
 
 
90
    def test_simple_pack(self):
 
91
        self.setup_smart_server_with_call_log()
 
92
        t = self.make_branch_and_tree('branch')
 
93
        self.build_tree_contents([('branch/foo', 'thecontents')])
 
94
        t.add("foo")
 
95
        t.commit("message")
 
96
        self.reset_smart_call_log()
 
97
        out, err = self.run_bzr(['pack', self.get_url('branch')])
 
98
        # This figure represent the amount of HPSS calls to perform this use
 
99
        # case. It is entirely ok to reduce this number if a test fails due to
 
100
        # rpc_count # being too low. If rpc_count increases, more network
 
101
        # roundtrips have become necessary for this use case. Please do not
 
102
        # adjust this number upwards without agreement from bzr's network
 
103
        # support maintainers.
 
104
        self.assertLength(6, self.hpss_calls)