~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_branch.py

  • Committer: Jonathan Riddell
  • Date: 2011-05-31 12:58:34 UTC
  • mto: This revision was merged to the branch mainline in revision 5954.
  • Revision ID: jriddell@canonical.com-20110531125834-ez3qx8m93ehhauwg
don't use non-ascii characters, also make test more reliable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2006-2011 Canonical Ltd
2
 
# coding: UTF-8
3
2
#
4
3
# This program is free software; you can redistribute it and/or modify
5
4
# it under the terms of the GNU General Public License as published by
68
67
        self.example_branch('a')
69
68
        #now add some random corruption
70
69
        pack = open('a/.bzr/repository/packs/' + os.listdir('a/.bzr/repository/packs')[0], "r")
71
 
        line1 = pack.read(724)
72
 
        pack.seek(746)
 
70
        line1 = pack.read(750)
73
71
        line2 = pack.read()
74
72
        pack.close()
75
73
        pack = open('a/.bzr/repository/packs/' + os.listdir('a/.bzr/repository/packs')[0], "w")
76
 
        pack.write(line1 + "îîîîîîîîîîîîîîîîîîîîîîîîîî" + line2)
 
74
        pack.write(line1 + "\xff" + line2)
77
75
        pack.close()
78
76
        self.run_bzr_error(['Corruption while decompressing pack files, this is caused by a local disk read error.\n'], 'branch a b', retcode=3)
79
77