/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_version_info.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-21 16:33:39 UTC
  • mto: This revision was merged to the branch mainline in revision 2028.
  • Revision ID: john@arbash-meinel.com-20060921163339-f96d93a31db0d88a
test feedback from Robert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from bzrlib.tests import TestCaseWithTransport
25
25
from bzrlib.rio import read_stanzas
26
26
 
27
 
# TODO: jam 20051228 When part of bzrlib, this should become
28
 
#       from bzrlib.generate_version_info import foo
29
 
 
30
27
from bzrlib.version_info_formats.format_rio import RioVersionInfoBuilder
31
28
from bzrlib.version_info_formats.format_python import PythonVersionInfoBuilder
32
29
 
44
41
        wt.add('b')
45
42
        wt.commit('b', rev_id='r2')
46
43
 
47
 
        open('branch/a', 'wb').write('new contents\n')
 
44
        self.build_tree_contents([('branch/a', 'new contents\n')])
48
45
        wt.commit('a2', rev_id='r3')
49
46
 
50
47
        return wt
149
146
        wt = self.create_branch()
150
147
 
151
148
        def regen(**kwargs):
 
149
            """Create a test module, import and return it"""
152
150
            outf = open('test_version_information.py', 'wb')
153
 
            builder = PythonVersionInfoBuilder(wt.branch, working_tree=wt,
154
 
                                               **kwargs)
155
 
            builder.generate(outf)
156
 
            outf.close()
 
151
            try:
 
152
                builder = PythonVersionInfoBuilder(wt.branch, working_tree=wt,
 
153
                                                   **kwargs)
 
154
                builder.generate(outf)
 
155
            finally:
 
156
                outf.close()
157
157
            module_info = imp.find_module('test_version_information',
158
158
                                          [os.getcwdu()])
159
159
            tvi = imp.load_module('tvi', *module_info)