~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-04-05 11:53:56 UTC
  • mfrom: (5753.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20110405115356-5d6k2moisuap7bi6
(jam) Merge 2.3 into bzr.dev, resolving some conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    )
43
43
from bzrlib.tests import (
44
44
    features,
 
45
    TestSkipped,
45
46
    scenarios,
46
47
    )
47
48
from bzrlib.util.configobj import configobj
2469
2470
# test_user_prompted ?
2470
2471
class TestAuthenticationRing(tests.TestCaseWithTransport):
2471
2472
    pass
 
2473
 
 
2474
 
 
2475
class TestAutoUserId(tests.TestCase):
 
2476
    """Test inferring an automatic user name."""
 
2477
 
 
2478
    def test_auto_user_id(self):
 
2479
        """Automatic inference of user name.
 
2480
        
 
2481
        This is a bit hard to test in an isolated way, because it depends on
 
2482
        system functions that go direct to /etc or perhaps somewhere else.
 
2483
        But it's reasonable to say that on Unix, with an /etc/mailname, we ought
 
2484
        to be able to choose a user name with no configuration.
 
2485
        """
 
2486
        if sys.platform == 'win32':
 
2487
            raise TestSkipped("User name inference not implemented on win32")
 
2488
        realname, address = config._auto_user_id()
 
2489
        if os.path.exists('/etc/mailname'):
 
2490
            self.assertTrue(realname)
 
2491
            self.assertTrue(address)
 
2492
        else:
 
2493
            self.assertEquals((None, None), (realname, address))
 
2494