/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: John Arbash Meinel
  • Date: 2008-09-02 18:37:02 UTC
  • mfrom: (3678 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3680.
  • Revision ID: john@arbash-meinel.com-20080902183702-16cpowcusfvo7rpv
Merge bzr.dev 3678, resolve NEWS

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):