diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/git/test_index.py | 6 | ||||
-rw-r--r-- | test/git/test_utils.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/test/git/test_index.py b/test/git/test_index.py index e9541232..6f57538f 100644 --- a/test/git/test_index.py +++ b/test/git/test_index.py @@ -42,7 +42,7 @@ class TestTree(TestBase): # write the data - it must match the original tmpfile = tempfile.mktemp() index_merge.write(tmpfile) - fp = open(tmpfile, 'r') + fp = open(tmpfile, 'rb') assert fp.read() == fixture("index_merge") fp.close() os.remove(tmpfile) @@ -164,14 +164,14 @@ class TestTree(TestBase): # reset the working copy as well to current head,to pull 'back' as well new_data = "will be reverted" file_path = os.path.join(rw_repo.git.git_dir, "CHANGES") - fp = open(file_path, "w") + fp = open(file_path, "wb") fp.write(new_data) fp.close() index.reset(rev_head_parent, working_tree=True) assert not index.diff(None) assert cur_branch == rw_repo.active_branch assert cur_commit == rw_repo.head.commit - fp = open(file_path) + fp = open(file_path,'rb') try: assert fp.read() != new_data finally: diff --git a/test/git/test_utils.py b/test/git/test_utils.py index 029d2054..69a9297d 100644 --- a/test/git/test_utils.py +++ b/test/git/test_utils.py @@ -56,7 +56,7 @@ class TestUtils(TestCase): def _cmp_contents(self, file_path, data): # raise if data from file at file_path # does not match data string - fp = open(file_path, "r") + fp = open(file_path, "rb") try: assert fp.read() == data finally: @@ -66,7 +66,7 @@ class TestUtils(TestCase): my_file = tempfile.mktemp() orig_data = "hello" new_data = "world" - my_file_fp = open(my_file, "w") + my_file_fp = open(my_file, "wb") my_file_fp.write(orig_data) my_file_fp.close() |