~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
372
372
 
373
373
    def test_crlf_bundle(self):
374
374
        try:
375
 
            read_bundle(StringIO('# Bazaar revision bundle v0.7\r\n'))
 
375
            read_bundle(StringIO('# Bazaar revision bundle v0.8\r\n'))
376
376
        except BadBundle:
377
377
            # It is currently permitted for bundles with crlf line endings to
378
378
            # make read_bundle raise a BadBundle, but this should be fixed.
809
809
        wt.commit('add one', rev_id='a@cset-0-1')
810
810
        self.build_tree(['b1/two'])
811
811
        wt.add('two')
812
 
        wt.commit('add two', rev_id='a@cset-0-2')
 
812
        wt.commit('add two', rev_id='a@cset-0-2',
 
813
                  revprops={'branch-nick':'test'})
813
814
 
814
815
        bundle_txt = StringIO()
815
816
        rev_ids = write_bundle(wt.branch.repository, 'a@cset-0-2',
820
821
 
821
822
    def check_valid(self, bundle):
822
823
        """Check that after whatever munging, the final object is valid."""
823
 
        self.assertEqual(['a@cset-0-2'], 
 
824
        self.assertEqual(['a@cset-0-2'],
824
825
            [r.revision_id for r in bundle.real_revisions])
825
826
 
826
827
    def test_extra_whitespace(self):
859
860
        # creates a blank line at the end, and fails if that
860
861
        # line is stripped
861
862
        self.assertEqual('\n\n', raw[-2:])
862
 
        bundle_text = StringIO(raw[:-1])
863
 
 
864
 
        bundle = read_bundle(bundle_txt)
865
 
        self.check_valid(bundle)
 
863
        bundle_txt = StringIO(raw[:-1])
 
864
 
 
865
        bundle = read_bundle(bundle_txt)
 
866
        self.check_valid(bundle)
 
867
 
 
868
    def test_opening_text(self):
 
869
        bundle_txt = self.build_test_bundle()
 
870
 
 
871
        bundle_txt = StringIO("Some random\nemail comments\n"
 
872
                              + bundle_txt.getvalue())
 
873
 
 
874
        bundle = read_bundle(bundle_txt)
 
875
        self.check_valid(bundle)
 
876
 
 
877
    def test_trailing_text(self):
 
878
        bundle_txt = self.build_test_bundle()
 
879
 
 
880
        bundle_txt = StringIO(bundle_txt.getvalue() +
 
881
                              "Some trailing\nrandom\ntext\n")
 
882
 
 
883
        bundle = read_bundle(bundle_txt)
 
884
        self.check_valid(bundle)
 
885