Rev 5639: (mbp) Tests for no user identity being set must cope with machines that have in file:///home/pqm/archives/thelove/bzr/2.3/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Apr 14 07:22:48 UTC 2011


At file:///home/pqm/archives/thelove/bzr/2.3/

------------------------------------------------------------
revno: 5639 [merge]
revision-id: pqm at pqm.ubuntu.com-20110414072246-gac895d95p35g4q9
parent: pqm at pqm.ubuntu.com-20110414064609-9sqkevpc19hvszb5
parent: mbp at sourcefrog.net-20110406043103-9lrlq2ztia52hn1z
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.3
timestamp: Thu 2011-04-14 07:22:46 +0000
message:
  (mbp) Tests for no user identity being set must cope with machines that have
   a mailname. (Martin Pool)
modified:
  bzrlib/tests/blackbox/test_commit.py test_commit.py-20060212094538-ae88fc861d969db0
  bzrlib/tests/blackbox/test_whoami.py test_whoami.py-20060629025641-8h3m2ch7kutqx7ug-1
  bzrlib/tests/per_repository/test_commit_builder.py test_commit_builder.py-20060606110838-76e3ra5slucqus81-1
=== modified file 'bzrlib/tests/blackbox/test_commit.py'
--- a/bzrlib/tests/blackbox/test_commit.py	2011-01-10 22:20:12 +0000
+++ b/bzrlib/tests/blackbox/test_commit.py	2011-04-06 04:18:06 +0000
@@ -23,6 +23,7 @@
 
 from bzrlib import (
     bzrdir,
+    config,
     osutils,
     ignores,
     msgeditor,
@@ -758,6 +759,9 @@
         self.run_bzr(['add'])
         self.overrideEnv('EMAIL', None)
         self.overrideEnv('BZR_EMAIL', None)
+        # Also, make sure that it's not inferred from mailname.
+        self.overrideAttr(config, '_auto_user_id',
+            lambda: (None, None))
         out, err = self.run_bzr(['commit', '-m', 'initial'], 3)
         self.assertContainsRe(err, 'Unable to determine your name')
 

=== modified file 'bzrlib/tests/blackbox/test_whoami.py'
--- a/bzrlib/tests/blackbox/test_whoami.py	2011-01-10 22:20:12 +0000
+++ b/bzrlib/tests/blackbox/test_whoami.py	2011-04-06 04:18:06 +0000
@@ -92,10 +92,13 @@
                           'recommended.\n', display)
 
     def test_whoami_not_set(self):
-        """Ensure whoami error if username is not set.
+        """Ensure whoami error if username is not set and not inferred.
         """
         self.overrideEnv('EMAIL', None)
         self.overrideEnv('BZR_EMAIL', None)
+        # Also, make sure that it's not inferred from mailname.
+        self.overrideAttr(config, '_auto_user_id',
+            lambda: (None, None))
         out, err = self.run_bzr(['whoami'], 3)
         self.assertContainsRe(err, 'Unable to determine your name')
 

=== modified file 'bzrlib/tests/per_repository/test_commit_builder.py'
--- a/bzrlib/tests/per_repository/test_commit_builder.py	2011-01-12 16:41:08 +0000
+++ b/bzrlib/tests/per_repository/test_commit_builder.py	2011-04-06 04:31:03 +0000
@@ -19,6 +19,7 @@
 import os
 
 from bzrlib import (
+    config,
     errors,
     graph,
     inventory,
@@ -1322,6 +1323,10 @@
         # Ensure that when no username is available but a committer is
         # supplied, commit works.
         self.overrideEnv('EMAIL', None)
+        self.overrideEnv('BZR_EMAIL', None)
+        # Also, make sure that it's not inferred from mailname.
+        self.overrideAttr(config, '_auto_user_id',
+            lambda: (None, None))
         tree = self.make_branch_and_tree(".")
         tree.lock_write()
         try:




More information about the bazaar-commits mailing list