~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2007-06-26 13:49:44 UTC
  • mto: (2581.1.1 cleanup-runbzr)
  • mto: This revision was merged to the branch mainline in revision 2588.
  • Revision ID: v.ladeuil+lp@free.fr-20070626134944-snlh5i0zsa30mysx
Enforce run_bzr(string) where possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
        """Check output from version command and master option is reasonable"""
117
117
        # output is intentionally passed through to stdout so that we
118
118
        # can see the version being tested
119
 
        output = self.run_bzr(['version'])[0]
 
119
        output = self.run_bzr('version')[0]
120
120
        self.log('bzr version output:')
121
121
        self.log(output)
122
122
        self.assert_(output.startswith('Bazaar (bzr) '))
123
123
        self.assertNotEqual(output.index('Canonical'), -1)
124
124
        # make sure --version is consistent
125
 
        tmp_output = self.run_bzr(['--version'])[0]
 
125
        tmp_output = self.run_bzr('--version')[0]
126
126
        self.assertEquals(output, tmp_output)
127
127
 
128
128
    def example_branch(test):
205
205
        
206
206
    def test_unknown_command(self):
207
207
        """Handling of unknown command."""
208
 
        out, err = self.run_bzr(['fluffy-badger'],
209
 
                                         retcode=3)
 
208
        out, err = self.run_bzr(['fluffy-badger'], retcode=3)
210
209
        self.assertEquals(out, '')
211
210
        err.index('unknown command')
212
211
 
485
484
            self.run_bzr('add link1')
486
485
            self.assertEquals(self.run_bzr('unknowns')[0], '')
487
486
            self.run_bzr(['commit', '-m', '1: added symlink link1'])
488
 
    
 
487
 
489
488
            mkdir('d1')
490
489
            self.run_bzr('add d1')
491
490
            self.assertEquals(self.run_bzr('unknowns')[0], '')
497
496
            os.symlink("NOWHERE3", "d1/link3")
498
497
            self.assertEquals(self.run_bzr('unknowns')[0], 'd1/link3\n')
499
498
            self.run_bzr(['commit', '-m', '2: added dir, symlink'])
500
 
    
 
499
 
501
500
            self.run_bzr('rename d1 d2')
502
501
            self.run_bzr('move d2/link2 .')
503
502
            self.run_bzr('move link1 d2')
505
504
            self.assertEquals(os.readlink("d2/link1"), "NOWHERE1")
506
505
            self.run_bzr('add d2/link3')
507
506
            self.run_bzr('diff', retcode=1)
508
 
            self.run_bzr(['commit', '-m', '3: rename of dir, move symlinks, add link3'])
509
 
    
 
507
            self.run_bzr(['commit', '-m',
 
508
                          '3: rename of dir, move symlinks, add link3'])
 
509
 
510
510
            os.unlink("link2")
511
511
            os.symlink("TARGET 2", "link2")
512
512
            os.unlink("d2/link1")
514
514
            self.run_bzr('diff', retcode=1)
515
515
            self.assertEquals(self.run_bzr("relpath d2/link1")[0], "d2/link1\n")
516
516
            self.run_bzr(['commit', '-m', '4: retarget of two links'])
517
 
    
 
517
 
518
518
            self.run_bzr('remove --keep d2/link1')
519
519
            self.assertEquals(self.run_bzr('unknowns')[0], 'd2/link1\n')
520
520
            self.run_bzr(['commit', '-m', '5: remove d2/link1'])
524
524
            self.run_bzr('rm --keep d2/link1')
525
525
            self.assertEquals(self.run_bzr('unknowns')[0], 'd2/link1\n')
526
526
            self.run_bzr(['commit', '-m', '7: remove d2/link1'])
527
 
    
 
527
 
528
528
            os.mkdir("d1")
529
529
            self.run_bzr('add d1')
530
530
            self.run_bzr('rename d2/link3 d1/link3new')
531
531
            self.assertEquals(self.run_bzr('unknowns')[0], 'd2/link1\n')
532
 
            self.run_bzr(['commit', '-m', '8: remove d2/link1, move/rename link3'])
533
 
            
534
 
            self.run_bzr(['check'])
535
 
            
536
 
            self.run_bzr(['export', '-r', '1', 'exp1.tmp'])
 
532
            self.run_bzr(['commit', '-m',
 
533
                          '8: remove d2/link1, move/rename link3'])
 
534
 
 
535
            self.run_bzr('check')
 
536
 
 
537
            self.run_bzr('export -r 1 exp1.tmp')
537
538
            chdir("exp1.tmp")
538
539
            self.assertEquals(listdir_sorted("."), [ "link1" ])
539
540
            self.assertEquals(os.readlink("link1"), "NOWHERE1")
540
541
            chdir("..")
541
 
            
542
 
            self.run_bzr(['export', '-r', '2', 'exp2.tmp'])
 
542
 
 
543
            self.run_bzr('export -r 2 exp2.tmp')
543
544
            chdir("exp2.tmp")
544
545
            self.assertEquals(listdir_sorted("."), [ "d1", "link1" ])
545
546
            chdir("..")
546
 
            
547
 
            self.run_bzr(['export', '-r', '3', 'exp3.tmp'])
 
547
 
 
548
            self.run_bzr('export -r 3 exp3.tmp')
548
549
            chdir("exp3.tmp")
549
550
            self.assertEquals(listdir_sorted("."), [ "d2", "link2" ])
550
551
            self.assertEquals(listdir_sorted("d2"), [ "link1", "link3" ])
551
552
            self.assertEquals(os.readlink("d2/link1"), "NOWHERE1")
552
553
            self.assertEquals(os.readlink("link2")   , "NOWHERE2")
553
554
            chdir("..")
554
 
            
555
 
            self.run_bzr(['export', '-r', '4', 'exp4.tmp'])
 
555
 
 
556
            self.run_bzr('export -r 4 exp4.tmp')
556
557
            chdir("exp4.tmp")
557
558
            self.assertEquals(listdir_sorted("."), [ "d2", "link2" ])
558
559
            self.assertEquals(os.readlink("d2/link1"), "TARGET 1")
559
560
            self.assertEquals(os.readlink("link2")   , "TARGET 2")
560
561
            self.assertEquals(listdir_sorted("d2"), [ "link1", "link3" ])
561
562
            chdir("..")
562
 
            
563
 
            self.run_bzr(['export', '-r', '5', 'exp5.tmp'])
 
563
 
 
564
            self.run_bzr('export -r 5 exp5.tmp')
564
565
            chdir("exp5.tmp")
565
566
            self.assertEquals(listdir_sorted("."), [ "d2", "link2" ])
566
567
            self.assert_(os.path.islink("link2"))
567
568
            self.assert_(listdir_sorted("d2")== [ "link3" ])
568
569
            chdir("..")
569
 
            
570
 
            self.run_bzr(['export', '-r', '8', 'exp6.tmp'])
 
570
 
 
571
            self.run_bzr('export -r 8 exp6.tmp')
571
572
            chdir("exp6.tmp")
572
573
            self.assertEqual(listdir_sorted("."), [ "d1", "d2", "link2"])
573
574
            self.assertEquals(listdir_sorted("d1"), [ "link3new" ])