/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_commit.py

  • Committer: Martin Pool
  • Date: 2007-08-16 01:04:10 UTC
  • mfrom: (2709 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2712.
  • Revision ID: mbp@sourcefrog.net-20070816010410-92814aa40xf7lja4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
470
470
             r"Commit refused\."],
471
471
            'commit -m add-b --fixes=orange',
472
472
            working_dir='tree')
 
473
 
 
474
    def test_no_author(self):
 
475
        """If the author is not specified, the author property is not set."""
 
476
        tree = self.make_branch_and_tree('tree')
 
477
        self.build_tree(['tree/hello.txt'])
 
478
        tree.add('hello.txt')
 
479
        self.run_bzr( 'commit -m hello tree/hello.txt')
 
480
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
481
        properties = last_rev.properties
 
482
        self.assertFalse('author' in properties)
 
483
 
 
484
    def test_author_sets_property(self):
 
485
        """commit --author='John Doe <jdoe@example.com>' sets the author
 
486
           revprop.
 
487
        """
 
488
        tree = self.make_branch_and_tree('tree')
 
489
        self.build_tree(['tree/hello.txt'])
 
490
        tree.add('hello.txt')
 
491
        self.run_bzr("commit -m hello --author='John Doe <jdoe@example.com>' "
 
492
                     "tree/hello.txt")
 
493
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
494
        properties = last_rev.properties
 
495
        self.assertEqual('John Doe <jdoe@example.com>', properties['author'])
 
496
 
 
497
    def test_author_no_email(self):
 
498
        """Author's name without an email address is allowed, too."""
 
499
        tree = self.make_branch_and_tree('tree')
 
500
        self.build_tree(['tree/hello.txt'])
 
501
        tree.add('hello.txt')
 
502
        out, err = self.run_bzr("commit -m hello --author='John Doe' "
 
503
                                "tree/hello.txt")
 
504
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
505
        properties = last_rev.properties
 
506
        self.assertEqual('John Doe', properties['author'])