~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-02 06:24:16 UTC
  • mfrom: (3635.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080902062416-dxdxccqki90bcynl
(robertc) Fix repack operations on SMB connections. (Robert Collins,
        bug 255656).

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
        is_inside_or_parent_of_any,
38
38
        pathjoin,
39
39
        pumpfile,
 
40
        pump_string_file,
40
41
        )
41
42
from bzrlib.tests import (
42
43
        probe_unicode_in_user_encoding,
440
441
            message = "Data not equal.  Expected %d bytes, received %d."
441
442
            self.fail(message % (len(response_data), self.test_data_len))
442
443
 
 
444
 
 
445
class TestPumpStringFile(TestCase):
 
446
 
 
447
    def test_empty(self):
 
448
        output = StringIO()
 
449
        pump_string_file("", output)
 
450
        self.assertEqual("", output.getvalue())
 
451
 
 
452
    def test_more_than_segment_size(self):
 
453
        output = StringIO()
 
454
        pump_string_file("123456789", output, 2)
 
455
        self.assertEqual("123456789", output.getvalue())
 
456
 
 
457
    def test_segment_size(self):
 
458
        output = StringIO()
 
459
        pump_string_file("12", output, 2)
 
460
        self.assertEqual("12", output.getvalue())
 
461
 
 
462
    def test_segment_size_multiple(self):
 
463
        output = StringIO()
 
464
        pump_string_file("1234", output, 2)
 
465
        self.assertEqual("1234", output.getvalue())
 
466
 
 
467
 
443
468
class TestSafeUnicode(TestCase):
444
469
 
445
470
    def test_from_ascii_string(self):