mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 14:58:03 +03:00
tests: make test-dispatch.py python3 compatible
Summary: Writing to a file opened in "b" mode needs byte strings. Reviewed By: sfilipco Differential Revision: D19668666 fbshipit-source-id: 9e8670fa080cc2a7fc611083a4ee2305d8262a3a
This commit is contained in:
parent
4604332170
commit
179aa8ac28
@ -3,10 +3,6 @@ from __future__ import absolute_import, print_function
|
||||
import os
|
||||
|
||||
from edenscm.mercurial import dispatch
|
||||
from hghave import require
|
||||
|
||||
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def testdispatch(cmd):
|
||||
@ -25,14 +21,14 @@ os.chdir("test1")
|
||||
|
||||
# create file 'foo', add and commit
|
||||
f = open("foo", "wb")
|
||||
f.write("foo\n")
|
||||
f.write(b"foo\n")
|
||||
f.close()
|
||||
testdispatch("add foo")
|
||||
testdispatch("commit -m commit1 -d 2000-01-01 foo")
|
||||
|
||||
# append to file 'foo' and commit
|
||||
f = open("foo", "ab")
|
||||
f.write("bar\n")
|
||||
f.write(b"bar\n")
|
||||
f.close()
|
||||
testdispatch("commit -m commit2 -d 2000-01-02 foo")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user