~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2016-02-07 18:23:13 UTC
  • mto: (6615.3.1 2.7)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20160207182313-jwz7z3vj4mpyjn7y
Ensure http://pad.lv/1323805 won't come back.

Since the 2.6.0 release pypi policy changed and release tarballs can't be
hosted on launchpad anymore, they have to be uploaded to
http://pypi.python.org/pypi


This fixes setup.py sdist to generate the right tarball with nearly the same
content as the one produced for 2.7.0.

Such a tarball have been uploaded to pypi properly signed and tested for
installation in venv.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2007, 2009-2012 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
32
32
        for i in range(total_lines):
33
33
            text += line_prefix + str(i+1) + "\n"
34
34
 
35
 
        open(path, 'w').write(text)
 
35
        with open(path, 'w') as f:
 
36
            f.write(text)
36
37
        if versioned:
37
38
            self.run_bzr(['add', path])
38
39
            self.run_bzr(['ci', '-m', '"' + path + '"'])
69
70
    def test_pack_clean_obsolete_packs(self):
70
71
        """Ensure --clean-obsolete-packs removes obsolete pack files
71
72
        """
72
 
        wd = 'foobar0'
73
 
        wt = self.make_branch_and_tree(wd)
74
 
        transport = wt.branch.repository.bzrdir.transport
75
 
        os.chdir(wd)
 
73
        wt = self.make_branch_and_tree('.')
 
74
        t = wt.branch.repository.bzrdir.transport
76
75
 
77
76
        # do multiple commits to ensure that obsolete packs are created
78
77
        # by 'bzr pack'
82
81
 
83
82
        out, err = self.run_bzr(['pack', '--clean-obsolete-packs'])
84
83
 
85
 
        pack_names = transport.list_dir('repository/obsolete_packs')
 
84
        pack_names = t.list_dir('repository/obsolete_packs')
86
85
        self.assertTrue(len(pack_names) == 0)
87
86
 
88
87
 
103
102
        # adjust this number upwards without agreement from bzr's network
104
103
        # support maintainers.
105
104
        self.assertLength(6, self.hpss_calls)
 
105
        self.assertLength(1, self.hpss_connections)
106
106
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)