/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/blackbox/test_status.py

  • Committer: Ian Clatworthy
  • Date: 2009-02-10 00:22:46 UTC
  • mto: (3992.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3993.
  • Revision ID: ian.clatworthy@canonical.com-20090210002246-bj56cq97fhdo951e
split tests as suggested by Jelmer's review

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
        self.assertEqualDiff('conflicts:\n  Contents conflict in dir2/file1\n',
285
285
                             tof.getvalue())
286
286
 
287
 
    def test_status_nonexistent_file(self):
288
 
        # files that don't exist in either the basis tree or working tree
289
 
        # should give an error
 
287
    def _prepare_nonexistent(self):
290
288
        wt = self.make_branch_and_tree('.')
291
289
        self.assertStatus([], wt)
292
290
        self.build_tree(['FILE_A', 'FILE_B', 'FILE_C', 'FILE_D', 'FILE_E', ])
302
300
        open('FILE_Q', 'w').write('FILE_Q is added but not committed.')
303
301
        wt.add('FILE_Q')  # FILE_Q will be added but not committed
304
302
        open('UNVERSIONED_BUT_EXISTING', 'w')
 
303
        return wt
305
304
 
 
305
    def test_status_nonexistent_file(self):
 
306
        # files that don't exist in either the basis tree or working tree
 
307
        # should give an error
 
308
        wt = self._prepare_nonexistent()
306
309
        self.assertStatus([
307
310
            'removed:\n',
308
311
            '  FILE_E\n',
315
318
            '  UNVERSIONED_BUT_EXISTING\n',
316
319
            ],
317
320
            wt)
318
 
 
319
321
        self.assertStatus([
320
322
            ' M  FILE_B\n',
321
323
            ' M  FILE_C\n',
338
340
        self.assertContainsRe(err,
339
341
                              r'.*ERROR: Path\(s\) do not exist: '
340
342
                              'NONEXISTENT.*')
341
 
 
342
343
        expected = [
343
344
          'X:   NONEXISTENT\n',
344
345
          ]
347
348
                              r'.*ERROR: Path\(s\) do not exist: '
348
349
                              'NONEXISTENT.*')
349
350
        
 
351
    def test_status_nonexistent_file_with_others(self):
350
352
        # bzr st [--short] NONEXISTENT ...others..
 
353
        wt = self._prepare_nonexistent()
351
354
        expected = [
352
355
          'removed:\n',
353
356
          '  FILE_E\n',
364
367
        self.assertContainsRe(err,
365
368
                              r'.*ERROR: Path\(s\) do not exist: '
366
369
                              'NONEXISTENT.*')
367
 
        
368
370
        expected = [
369
371
          ' D  FILE_E\n',
370
372
          ' M  FILE_C\n',
379
381
                              r'.*ERROR: Path\(s\) do not exist: '
380
382
                              'NONEXISTENT.*')
381
383
        
 
384
    def test_status_multiple_nonexistent_files(self):
382
385
        # bzr st [--short] NONEXISTENT ... ANOTHER_NONEXISTENT ...
 
386
        wt = self._prepare_nonexistent()
383
387
        expected = [
384
388
          'removed:\n',
385
389
          '  FILE_E\n',
397
401
        self.assertContainsRe(err,
398
402
                              r'.*ERROR: Path\(s\) do not exist: '
399
403
                              'ANOTHER_NONEXISTENT NONEXISTENT.*')
400
 
        
401
404
        expected = [
402
405
          ' D  FILE_E\n',
403
406
          ' M  FILE_C\n',
413
416
                              r'.*ERROR: Path\(s\) do not exist: '
414
417
                              'ANOTHER_NONEXISTENT NONEXISTENT.*')
415
418
        
 
419
    def test_status_nonexistent_file_with_unversioned(self):
416
420
        # bzr st [--short] NONEXISTENT A B UNVERSIONED_BUT_EXISTING C D E Q
 
421
        wt = self._prepare_nonexistent()
417
422
        expected = [
418
423
          'removed:\n',
419
424
          '  FILE_E\n',
434
439
        self.assertContainsRe(err,
435
440
                              r'.*ERROR: Path\(s\) do not exist: '
436
441
                              'NONEXISTENT.*')
437
 
        
438
442
        expected = [
439
443
          '+N  FILE_Q\n',
440
444
          '?   UNVERSIONED_BUT_EXISTING\n',