Rev 3702: (Mark Hammond) Fix some test code that was writing in text mode, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Sep 10 21:45:09 BST 2008


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

------------------------------------------------------------
revno: 3702
revision-id: pqm at pqm.ubuntu.com-20080910204500-1hs4q0smfcsk7wz0
parent: pqm at pqm.ubuntu.com-20080910201504-ennm0qxaeb8yk02l
parent: john at arbash-meinel.com-20080910195236-ctx16y1pjgi7m2wl
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2008-09-10 21:45:00 +0100
message:
  (Mark Hammond) Fix some test code that was writing in text mode,
  	and reading in binary
modified:
  bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
    ------------------------------------------------------------
    revno: 3693.1.2
    revision-id: john at arbash-meinel.com-20080910195236-ctx16y1pjgi7m2wl
    parent: mhammond at skippinet.com.au-20080906080523-6t2ghw0q2xqyffvx
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: jam-integration
    timestamp: Wed 2008-09-10 14:52:36 -0500
    message:
      Use build_tree_contents instead of direct open().write()
    modified:
      bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
    ------------------------------------------------------------
    revno: 3693.1.1
    revision-id: mhammond at skippinet.com.au-20080906080523-6t2ghw0q2xqyffvx
    parent: pqm at pqm.ubuntu.com-20080905212548-ig8wqqpv4vb8b2v4
    committer: Mark Hammond <mhammond at skippinet.com.au>
    branch nick: bzr.work
    timestamp: Sat 2008-09-06 18:05:23 +1000
    message:
      open the test file in binary mode to ensure we work on Windows
    modified:
      bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
=== modified file 'bzrlib/tests/test_transport_implementations.py'
--- a/bzrlib/tests/test_transport_implementations.py	2008-06-09 07:20:06 +0000
+++ b/bzrlib/tests/test_transport_implementations.py	2008-09-10 19:52:36 +0000
@@ -1252,7 +1252,7 @@
         self.failIf(t3.has('b/d'))
 
         if t1.is_readonly():
-            open('b/d', 'wb').write('newfile\n')
+            self.build_tree_contents([('b/d', 'newfile\n')])
         else:
             t2.put_bytes('d', 'newfile\n')
 
@@ -1546,7 +1546,7 @@
         content = osutils.rand_bytes(200*1024)
         content_size = len(content)
         if transport.is_readonly():
-            file('a', 'w').write(content)
+            self.build_tree_contents([('a', content)])
         else:
             transport.put_bytes('a', content)
         def check_result_data(result_vector):




More information about the bazaar-commits mailing list