~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_transport.py

  • Committer: John Arbash Meinel
  • Date: 2011-05-26 08:05:45 UTC
  • mfrom: (5916 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5917.
  • Revision ID: john@arbash-meinel.com-20110526080545-5tprxfczyj4bfk0o
Merge bzr.dev 5916 and make sure the right patch is applied.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1626
1626
    def test_readv(self):
1627
1627
        transport = self.get_transport()
1628
1628
        if transport.is_readonly():
1629
 
            file('a', 'w').write('0123456789')
 
1629
            with file('a', 'w') as f: f.write('0123456789')
1630
1630
        else:
1631
1631
            transport.put_bytes('a', '0123456789')
1632
1632
 
1642
1642
    def test_readv_out_of_order(self):
1643
1643
        transport = self.get_transport()
1644
1644
        if transport.is_readonly():
1645
 
            file('a', 'w').write('0123456789')
 
1645
            with file('a', 'w') as f: f.write('0123456789')
1646
1646
        else:
1647
1647
            transport.put_bytes('a', '01234567890')
1648
1648
 
1720
1720
        transport = self.get_transport()
1721
1721
        # test from observed failure case.
1722
1722
        if transport.is_readonly():
1723
 
            file('a', 'w').write('a'*1024*1024)
 
1723
            with file('a', 'w') as f: f.write('a'*1024*1024)
1724
1724
        else:
1725
1725
            transport.put_bytes('a', 'a'*1024*1024)
1726
1726
        broken_vector = [(465219, 800), (225221, 800), (445548, 800),
1760
1760
    def test_readv_short_read(self):
1761
1761
        transport = self.get_transport()
1762
1762
        if transport.is_readonly():
1763
 
            file('a', 'w').write('0123456789')
 
1763
            with file('a', 'w') as f: f.write('0123456789')
1764
1764
        else:
1765
1765
            transport.put_bytes('a', '01234567890')
1766
1766