~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Lukáš Lalinský
  • Date: 2007-12-02 18:59:28 UTC
  • mto: This revision was merged to the branch mainline in revision 3080.
  • Revision ID: lalinsky@gmail.com-20071202185928-00cgoqzowl3s87hi
Move the name and e-mail address extraction logic to config.parse_username.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1083
1083
        self.assertRaises(errors.NoEmailInUsername,
1084
1084
                          config.extract_email_address, 'Jane Tester')
1085
1085
 
 
1086
    def test_parse_username(self):
 
1087
        self.assertEqual(('', 'jdoe@example.com'),
 
1088
                         config.parse_username('jdoe@example.com'))
 
1089
        self.assertEqual(('', 'jdoe@example.com'),
 
1090
                         config.parse_username('<jdoe@example.com>'))
 
1091
        self.assertEqual(('John Doe', 'jdoe@example.com'),
 
1092
                         config.parse_username('John Doe <jdoe@example.com>'))
 
1093
        self.assertEqual(('John Doe', ''),
 
1094
                         config.parse_username('John Doe'))
1086
1095
 
1087
1096
class TestTreeConfig(tests.TestCaseWithTransport):
1088
1097