Skip to content

Commit

Permalink
Python3 support (dsoprea#66)
Browse files Browse the repository at this point in the history
* Making tests running successfully for python3

* removed python 2.6
  • Loading branch information
tusharmakkar08 authored and dsoprea committed Sep 26, 2016
1 parent be6e20b commit a49ac35
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"

install:
- pip install -r svn/resources/requirements.txt
- pip install coveralls
Expand Down
2 changes: 1 addition & 1 deletion svn/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def diff(self, old, new, rel_path=None):
'--new', '{0}@{1}'.format(full_url_or_path, new)],
combine=True)
file_to_diff = {}
for non_empty_diff in filter(None, diff_result.split('Index: ')):
for non_empty_diff in filter(None, diff_result.decode('utf8').split('Index: ')):
split_diff = non_empty_diff.split('==')
file_to_diff[split_diff[0].strip().strip('/')] = split_diff[-1].strip('=').strip()
diff_summaries = self.diff_summary(old, new, rel_path)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest
import shutil

from resources.expected_output import diff_summary, diff_summary_2, cat
from tests.resources.expected_output import diff_summary, diff_summary_2, cat
from svn.common import CommonClient, SvnException


Expand Down Expand Up @@ -63,7 +63,7 @@ def test_list(self):
:return:
"""
actual_answer = CommonClient(self.test_svn_url, 'url').list()
self.assertEqual(actual_answer.next(), 'abdera/')
self.assertEqual(next(actual_answer), 'abdera/')

def test_info(self):
"""
Expand All @@ -82,15 +82,15 @@ def test_log(self):
:return:
"""
actual_answer = CommonClient(self.test_svn_url, 'url').log_default(revision_from=1761404, revision_to=1761403)
self.assertEqual(actual_answer.next().author, 'sseifert')
self.assertEqual(next(actual_answer).author, 'sseifert')

def test_cat(self):
"""
Checking cat
:return:
"""
actual_answer = CommonClient(self.test_svn_url, 'url').cat('abdera/abdera2/README', revision=1761404)
self.assertEqual(cat, actual_answer)
self.assertEqual(cat, actual_answer.decode())

def test_export(self):
"""
Expand Down

0 comments on commit a49ac35

Please sign in to comment.