~mbp/bzr/help

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-18 19:22:46 UTC
  • mfrom: (5861.2.7 bzr-pypy)
  • Revision ID: pqm@pqm.ubuntu.com-20110518192246-x1duixv8rt9v2xml
(mbp) be more careful about closing files in selftest,
 so that more of it passes on pypy (Wouter van Heyst)

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
        wt.add('FILE_D')
325
325
        wt.add('FILE_E')
326
326
        wt.commit('Create five empty files.')
327
 
        open('FILE_B', 'w').write('Modification to file FILE_B.')
328
 
        open('FILE_C', 'w').write('Modification to file FILE_C.')
 
327
        with open('FILE_B', 'w') as f: f.write('Modification to file FILE_B.')
 
328
        with open('FILE_C', 'w') as f: f.write('Modification to file FILE_C.')
329
329
        unlink('FILE_E')  # FILE_E will be versioned but missing
330
 
        open('FILE_Q', 'w').write('FILE_Q is added but not committed.')
 
330
        with open('FILE_Q', 'w') as f: f.write('FILE_Q is added but not committed.')
331
331
        wt.add('FILE_Q')  # FILE_Q will be added but not committed
332
332
        open('UNVERSIONED_BUT_EXISTING', 'w')
333
333
        return wt
477
477
          ' M  FILE_B\n',
478
478
          'X   NONEXISTENT\n',
479
479
          ]
 
480
        expected.sort()
480
481
        out, err = self.run_bzr('status --short NONEXISTENT '
481
482
                                'FILE_A FILE_B UNVERSIONED_BUT_EXISTING '
482
483
                                'FILE_C FILE_D FILE_E FILE_Q', retcode=3)
483
 
        self.assertEqual(expected, out.splitlines(True))
 
484
        actual = out.splitlines(True)
 
485
        actual.sort()
 
486
        self.assertEqual(expected, actual)
484
487
        self.assertContainsRe(err,
485
488
                              r'.*ERROR: Path\(s\) do not exist: '
486
489
                              'NONEXISTENT.*')