Rev 3620: (Mark Hammond) Win32 test fixes in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Aug 12 21:19:00 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3620
revision-id: pqm at pqm.ubuntu.com-20080812201855-9qxbdo0t2h9byzhj
parent: pqm at pqm.ubuntu.com-20080811083307-tbibm26paa3r4hg8
parent: mhammond at skippinet.com.au-20080812022136-vmynpj251uflufyb
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2008-08-12 21:18:55 +0100
message:
  (Mark Hammond) Win32 test fixes
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
  bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
  bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
  bzrlib/tests/test_plugins.py   plugins.py-20050622075746-32002b55e5e943e9
  bzrlib/tests/test_source.py    test_source.py-20051207061333-a58dea6abecc030d
  bzrlib/transport/local.py      local_transport.py-20050711165921-9b1f142bfe480c24
    ------------------------------------------------------------
    revno: 3616.2.12
    revision-id: mhammond at skippinet.com.au-20080812022136-vmynpj251uflufyb
    parent: mhammond at skippinet.com.au-20080811125016-da5gx8vxab0izs0p
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Tue 2008-08-12 12:21:36 +1000
    message:
      use osutils.realpath instead of os.path.realpath so we get fwd slashes.
    modified:
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
    ------------------------------------------------------------
    revno: 3616.2.11
    revision-id: mhammond at skippinet.com.au-20080811125016-da5gx8vxab0izs0p
    parent: mhammond at skippinet.com.au-20080811023244-qfb1rhqlcpecz3f2
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Mon 2008-08-11 22:50:16 +1000
    message:
      3rd go at test_set_plugins_path_with_trailing_slashes in a Windows 
      binary!  This time just do what the test says it does (trailing slashes) 
      and don't try to predict anything about the rest of the path.
    modified:
      bzrlib/tests/test_plugins.py   plugins.py-20050622075746-32002b55e5e943e9
    ------------------------------------------------------------
    revno: 3616.2.10
    revision-id: mhammond at skippinet.com.au-20080811023244-qfb1rhqlcpecz3f2
    parent: mhammond at skippinet.com.au-20080811021449-pa1k1smny3l631r6
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Mon 2008-08-11 12:32:44 +1000
    message:
      docstring for transport.local.local_abspath() avoids potential confusion
      about the path seps in the return value.
    modified:
      bzrlib/transport/local.py      local_transport.py-20050711165921-9b1f142bfe480c24
    ------------------------------------------------------------
    revno: 3616.2.9
    revision-id: mhammond at skippinet.com.au-20080811021449-pa1k1smny3l631r6
    parent: mhammond at skippinet.com.au-20080811020443-koy7d1dhucshppkv
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Mon 2008-08-11 12:14:49 +1000
    message:
      Make it clear the paths differ only by the path sep.
    modified:
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
    ------------------------------------------------------------
    revno: 3616.2.8
    revision-id: mhammond at skippinet.com.au-20080811020443-koy7d1dhucshppkv
    parent: mhammond at skippinet.com.au-20080811020400-7mnjrjl02b5w9uzf
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Mon 2008-08-11 12:04:43 +1000
    message:
      make plugin test clearer and simpler.
    modified:
      bzrlib/tests/test_plugins.py   plugins.py-20050622075746-32002b55e5e943e9
    ------------------------------------------------------------
    revno: 3616.2.7
    revision-id: mhammond at skippinet.com.au-20080811020400-7mnjrjl02b5w9uzf
    parent: mhammond at skippinet.com.au-20080810112650-ggmv29q5pj4tipxx
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Mon 2008-08-11 12:04:00 +1000
    message:
      prefer getattr() over hasattr()
    modified:
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/test_source.py    test_source.py-20051207061333-a58dea6abecc030d
    ------------------------------------------------------------
    revno: 3616.2.6
    revision-id: mhammond at skippinet.com.au-20080810112650-ggmv29q5pj4tipxx
    parent: mhammond at skippinet.com.au-20080810104637-6fx12scg4op1wbls
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Sun 2008-08-10 21:26:50 +1000
    message:
      Fix test_set_user_setting_sets_and_saves2 on windows by stripping EOL
    modified:
      bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
    ------------------------------------------------------------
    revno: 3616.2.5
    revision-id: mhammond at skippinet.com.au-20080810104637-6fx12scg4op1wbls
    parent: mhammond at skippinet.com.au-20080810080119-u13jb505t813vi3k
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Sun 2008-08-10 20:46:37 +1000
    message:
      don't try and test source code when we are frozen.
    modified:
      bzrlib/tests/test_source.py    test_source.py-20051207061333-a58dea6abecc030d
    ------------------------------------------------------------
    revno: 3616.2.4
    revision-id: mhammond at skippinet.com.au-20080810080119-u13jb505t813vi3k
    parent: mhammond at skippinet.com.au-20080810070059-w9sml0t600ayirto
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Sun 2008-08-10 18:01:19 +1000
    message:
      fix test_set_plugins_path_with_trailing_slashes in windows binaries
    modified:
      bzrlib/tests/test_plugins.py   plugins.py-20050622075746-32002b55e5e943e9
    ------------------------------------------------------------
    revno: 3616.2.3
    revision-id: mhammond at skippinet.com.au-20080810070059-w9sml0t600ayirto
    parent: mhammond at skippinet.com.au-20080810065533-qesggahuxwh189ea
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Sun 2008-08-10 17:00:59 +1000
    message:
      Fix test failures due to missing check_repo_format_for_funky_id_on_win32
    modified:
      bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
    ------------------------------------------------------------
    revno: 3616.2.2
    revision-id: mhammond at skippinet.com.au-20080810065533-qesggahuxwh189ea
    parent: mhammond at skippinet.com.au-20080809073744-9rifv2fv3ygu052a
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Sun 2008-08-10 16:55:33 +1000
    message:
      Fix test_bzrdir.ChrootedTests on Windows by ensuring paths always go
      via os.path.realpath() before being compared.
    modified:
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
    ------------------------------------------------------------
    revno: 3616.2.1
    revision-id: mhammond at skippinet.com.au-20080809073744-9rifv2fv3ygu052a
    parent: pqm at pqm.ubuntu.com-20080808061719-ixk3x48n198814tg
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work.tests.blackbox
    timestamp: Sat 2008-08-09 17:37:44 +1000
    message:
      Fix how blackbox tests start bzr from frozen executables.
    modified:
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2008-08-04 07:55:41 +0000
+++ b/bzrlib/tests/__init__.py	2008-08-11 02:04:00 +0000
@@ -1591,7 +1591,10 @@
             # so we will avoid using it on all platforms, just to
             # make sure the code path is used, and we don't break on win32
             cleanup_environment()
-            command = [sys.executable, bzr_path]
+            command = [sys.executable]
+            # frozen executables don't need the path to bzr
+            if getattr(sys, "frozen", None) is None:
+                command.append(bzr_path)
             if not allow_plugins:
                 command.append('--no-plugins')
             command.extend(process_args)

=== modified file 'bzrlib/tests/interrepository_implementations/test_fetch.py'
--- a/bzrlib/tests/interrepository_implementations/test_fetch.py	2008-06-11 04:20:16 +0000
+++ b/bzrlib/tests/interrepository_implementations/test_fetch.py	2008-08-10 07:00:59 +0000
@@ -36,6 +36,9 @@
 from bzrlib.tests.interrepository_implementations import (
     TestCaseWithInterRepository,
     )
+from bzrlib.tests.interrepository_implementations.test_interrepository import (
+    check_repo_format_for_funky_id_on_win32
+    )
 
 
 class TestInterRepository(TestCaseWithInterRepository):

=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py	2008-08-01 07:30:20 +0000
+++ b/bzrlib/tests/test_bzrdir.py	2008-08-12 02:21:36 +0000
@@ -30,6 +30,7 @@
     errors,
     help_topics,
     repository,
+    osutils,
     symbol_versioning,
     urlutils,
     win32utils,
@@ -532,7 +533,7 @@
         self.assertEqual(os.path.realpath('topdir'),
                          self.local_branch_path(branch))
         self.assertEqual(
-            os.path.realpath(os.path.join('topdir', '.bzr', 'repository')),
+            osutils.realpath(os.path.join('topdir', '.bzr', 'repository')),
             repo.bzrdir.transport.local_abspath('repository'))
         self.assertEqual(relpath, 'foo')
 
@@ -545,7 +546,7 @@
         self.assertEqual(os.path.realpath('branch'),
                          self.local_branch_path(branch))
         self.assertEqual(
-            os.path.realpath(os.path.join('branch', '.bzr', 'repository')),
+            osutils.realpath(os.path.join('branch', '.bzr', 'repository')),
             repo.bzrdir.transport.local_abspath('repository'))
         self.assertEqual(relpath, 'foo')
 
@@ -557,7 +558,7 @@
         self.assertEqual(tree, None)
         self.assertEqual(branch, None)
         self.assertEqual(
-            os.path.realpath(os.path.join('repo', '.bzr', 'repository')),
+            osutils.realpath(os.path.join('repo', '.bzr', 'repository')),
             repo.bzrdir.transport.local_abspath('repository'))
         self.assertEqual(relpath, '')
 
@@ -572,7 +573,7 @@
         self.assertEqual(os.path.realpath('shared/branch'),
                          self.local_branch_path(branch))
         self.assertEqual(
-            os.path.realpath(os.path.join('shared', '.bzr', 'repository')),
+            osutils.realpath(os.path.join('shared', '.bzr', 'repository')),
             repo.bzrdir.transport.local_abspath('repository'))
         self.assertEqual(relpath, '')
 
@@ -587,7 +588,7 @@
         self.assertEqual(os.path.realpath('foo'),
                          self.local_branch_path(branch))
         self.assertEqual(
-            os.path.realpath(os.path.join('foo', '.bzr', 'repository')),
+            osutils.realpath(os.path.join('foo', '.bzr', 'repository')),
             repo.bzrdir.transport.local_abspath('repository'))
         self.assertEqual(relpath, 'bar')
 
@@ -600,7 +601,7 @@
         self.assertEqual(tree, None)
         self.assertEqual(branch, None)
         self.assertEqual(
-            os.path.realpath(os.path.join('bar', '.bzr', 'repository')),
+            osutils.realpath(os.path.join('bar', '.bzr', 'repository')),
             repo.bzrdir.transport.local_abspath('repository'))
         self.assertEqual(relpath, 'baz')
 

=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2008-06-16 19:09:28 +0000
+++ b/bzrlib/tests/test_config.py	2008-08-10 11:26:50 +0000
@@ -951,8 +951,8 @@
         self.assertIs(self.my_config.get_user_option('foo'), None)
         self.my_config.set_user_option('foo', 'bar')
         self.assertEqual(
-            self.my_config.branch.control_files.files['branch.conf'],
-            'foo = bar\n')
+            self.my_config.branch.control_files.files['branch.conf'].strip(),
+            'foo = bar')
         self.assertEqual(self.my_config.get_user_option('foo'), 'bar')
         self.my_config.set_user_option('foo', 'baz',
                                        store=config.STORE_LOCATION)

=== modified file 'bzrlib/tests/test_plugins.py'
--- a/bzrlib/tests/test_plugins.py	2008-05-08 04:21:01 +0000
+++ b/bzrlib/tests/test_plugins.py	2008-08-11 12:50:16 +0000
@@ -437,7 +437,7 @@
 
     def test_set_plugins_path_with_trailing_slashes(self):
         """set_plugins_path should set the module __path__ based on
-        BZR_PLUGIN_PATH."""
+        BZR_PLUGIN_PATH after removing all trailing slashes."""
         old_path = bzrlib.plugins.__path__
         old_env = os.environ.get('BZR_PLUGIN_PATH')
         try:
@@ -445,8 +445,9 @@
             os.environ['BZR_PLUGIN_PATH'] = "first\\//\\" + os.pathsep + \
                 "second/\\/\\/"
             bzrlib.plugin.set_plugins_path()
-            expected_path = ['first', 'second',
-                os.path.dirname(bzrlib.plugins.__file__)]
+            # We expect our nominated paths to have all path-seps removed,
+            # and this is testing only that.
+            expected_path = ['first', 'second']
             self.assertEqual(expected_path,
                 bzrlib.plugins.__path__[:len(expected_path)])
         finally:

=== modified file 'bzrlib/tests/test_source.py'
--- a/bzrlib/tests/test_source.py	2008-04-24 07:38:09 +0000
+++ b/bzrlib/tests/test_source.py	2008-08-11 02:04:00 +0000
@@ -55,6 +55,8 @@
 
     def source_file_name(self, package):
         """Return the path of the .py file for package."""
+        if getattr(sys, "frozen", None) is not None:
+            raise TestSkipped("can't test sources in frozen distributions.")
         path = package.__file__
         if path[-1] in 'co':
             return path[:-1]

=== modified file 'bzrlib/transport/local.py'
--- a/bzrlib/transport/local.py	2008-07-11 23:05:17 +0000
+++ b/bzrlib/transport/local.py	2008-08-11 02:32:44 +0000
@@ -117,8 +117,9 @@
         This function only exists for the LocalTransport, since it is
         the only one that has direct local access.
         This is mostly for stuff like WorkingTree which needs to know
-        the local working directory.
-        
+        the local working directory.  The returned path will always contain
+        forward slashes as the path separator, regardless of the platform.
+
         This function is quite expensive: it calls realpath which resolves
         symlinks.
         """




More information about the bazaar-commits mailing list