~bzr/ubuntu/natty/bzrtools/beta-ppa

« back to all changes in this revision

Viewing changes to tests/upstream_import.py

  • Committer: Max Bowsher
  • Date: 2011-02-04 02:16:01 UTC
  • mfrom: (702.1.2 unstable)
  • Revision ID: maxb@f2s.com-20110204021601-0gfzrmzfue68f1rm
Tags: 2.3.1-1~bazaar1~natty1
Merge 2.3.1-1 final

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
            f.write('Now?')
120
120
            f.close()
121
121
            archive_file.add(prefix + 'README')
122
 
            archive_file.close()
123
122
 
124
 
            archive_file = builder(result, 'a')
 
123
            f = file(prefix + 'README', 'wb')
 
124
            f.write('Wow?')
 
125
            f.close()
 
126
            # Add a second entry for README with different contents.
125
127
            archive_file.add(prefix + 'README')
126
128
            archive_file.close()
127
129
 
218
220
            archive_file = self.make_archive2(builder, subdir)
219
221
            importer(tree, archive_file)
220
222
            self.assertTrue(tree.path2id('README') is not None)
 
223
            # Ensure the second version of the file is used.
 
224
            self.assertEqual(tree.get_file_text(tree.path2id('README')),
 
225
                             'Wow?')
221
226
            self.assertTrue(not os.path.exists(tree.abspath('FEEDME')))
222
227
        finally:
223
228
            tree.unlock()