/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 breezy/tests/test_merge3.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from io import BytesIO
17
18
 
18
19
from .. import (
19
20
    merge3,
20
21
    tests,
21
22
    )
22
23
from ..errors import BinaryFile
23
 
from ..sixish import (
24
 
    BytesIO,
25
 
    int2byte,
26
 
    )
27
24
 
28
25
 
29
26
def split_lines(t):
325
322
    def test_minimal_conflicts_unique(self):
326
323
        def add_newline(s):
327
324
            """Add a newline to each entry in the string"""
328
 
            return [(int2byte(x) + b'\n') for x in bytearray(s)]
 
325
            return [(bytes([x]) + b'\n') for x in bytearray(s)]
329
326
 
330
327
        base_text = add_newline(b"abcdefghijklm")
331
328
        this_text = add_newline(b"abcdefghijklmNOPQRSTUVWXYZ")
343
340
    def test_minimal_conflicts_nonunique(self):
344
341
        def add_newline(s):
345
342
            """Add a newline to each entry in the string"""
346
 
            return [(int2byte(x) + b'\n') for x in bytearray(s)]
 
343
            return [(bytes([x]) + b'\n') for x in bytearray(s)]
347
344
 
348
345
        base_text = add_newline(b"abacddefgghij")
349
346
        this_text = add_newline(b"abacddefgghijkalmontfprz")