~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Robert Collins
  • Date: 2005-11-27 22:38:34 UTC
  • mfrom: (1185.33.36 bzr.dev)
  • Revision ID: robertc@robertcollins.net-20051127223834-d00ecca0d0b9384a
Merge from mpool, adjusting check to retain HTTP support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
352
352
        self.runbzr('diff')
353
353
 
354
354
    def test_diff_branches(self):
355
 
        self.build_tree(['branch1/', 'branch1/file', 'branch2/'])
 
355
        self.build_tree(['branch1/', 'branch1/file', 'branch2/'], line_endings='binary')
356
356
        branch = Branch.initialize('branch1')
357
357
        branch.add(['file'])
358
358
        branch.working_tree().commit('add file')
359
359
        copy_branch(branch, 'branch2')
360
 
        print >> open('branch2/file', 'w'), 'new content'
 
360
        print >> open('branch2/file', 'wb'), 'new content'
361
361
        branch2 = Branch.open('branch2')
362
362
        branch2.working_tree().commit('update file')
363
363
        # should open branch1 and diff against branch2, 
529
529
        self.runbzr('pull ../b')
530
530
        self.runbzr('pull ../b')
531
531
 
 
532
    def test_inventory(self):
 
533
        bzr = self.runbzr
 
534
        def output_equals(value, *args):
 
535
            out = self.runbzr(['inventory'] + list(args), backtick=True)
 
536
            self.assertEquals(out, value)
 
537
 
 
538
        bzr('init')
 
539
        open('a', 'wb').write('hello\n')
 
540
        os.mkdir('b')
 
541
 
 
542
        bzr('add a b')
 
543
        bzr('commit -m add')
 
544
 
 
545
        output_equals('a\n', '--kind', 'file')
 
546
        output_equals('b\n', '--kind', 'directory')        
 
547
 
532
548
    def test_ls(self):
533
549
        """Test the abilities of 'bzr ls'"""
534
550
        bzr = self.runbzr
1241
1257
        output = self.capture('log %s' % url)
1242
1258
        self.assertEqual(8, len(output.split('\n')))
1243
1259
        
1244
 
 
1245
 
 
1246
 
 
 
1260
    def test_check(self):
 
1261
        self.build_tree(['branch/', 'branch/file'])
 
1262
        branch = Branch.initialize('branch')
 
1263
        branch.add(['file'])
 
1264
        branch.working_tree().commit('add file', rev_id='A')
 
1265
        url = self.get_remote_url('branch/file')
 
1266
        self.run_bzr('check', url)