~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-08 19:00:14 UTC
  • mto: This revision was merged to the branch mainline in revision 6359.
  • Revision ID: martin.packman@canonical.com-20111208190014-mi8jm6v7jygmhb0r
Use --include-duplicates for make update-pot which already combines multiple msgid strings prettily

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009-2012 Canonical Ltd
 
1
# Copyright (C) 2007, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
import os
20
20
 
21
21
from bzrlib import tests
22
 
from bzrlib.tests.matchers import ContainsNoVfsCalls
23
22
 
24
23
 
25
24
class TestPack(tests.TestCaseWithTransport):
32
31
        for i in range(total_lines):
33
32
            text += line_prefix + str(i+1) + "\n"
34
33
 
35
 
        with open(path, 'w') as f:
36
 
            f.write(text)
 
34
        open(path, 'w').write(text)
37
35
        if versioned:
38
36
            self.run_bzr(['add', path])
39
37
            self.run_bzr(['ci', '-m', '"' + path + '"'])
70
68
    def test_pack_clean_obsolete_packs(self):
71
69
        """Ensure --clean-obsolete-packs removes obsolete pack files
72
70
        """
73
 
        wt = self.make_branch_and_tree('.')
74
 
        t = wt.branch.repository.bzrdir.transport
 
71
        wd = 'foobar0'
 
72
        wt = self.make_branch_and_tree(wd)
 
73
        transport = wt.branch.repository.bzrdir.transport
 
74
        os.chdir(wd)
75
75
 
76
76
        # do multiple commits to ensure that obsolete packs are created
77
77
        # by 'bzr pack'
81
81
 
82
82
        out, err = self.run_bzr(['pack', '--clean-obsolete-packs'])
83
83
 
84
 
        pack_names = t.list_dir('repository/obsolete_packs')
 
84
        pack_names = transport.list_dir('repository/obsolete_packs')
85
85
        self.assertTrue(len(pack_names) == 0)
86
86
 
87
87
 
102
102
        # adjust this number upwards without agreement from bzr's network
103
103
        # support maintainers.
104
104
        self.assertLength(6, self.hpss_calls)
105
 
        self.assertLength(1, self.hpss_connections)
106
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)