Skip to content
Snippets Groups Projects
Commit 32a91b6f authored by Jonas Haag's avatar Jonas Haag
Browse files

Python 3 ctags support

parent 07651376
No related branches found
No related tags found
No related merge requests found
...@@ -96,9 +96,9 @@ class FancyRepo(dulwich.repo.Repo): ...@@ -96,9 +96,9 @@ class FancyRepo(dulwich.repo.Repo):
def get_tag_and_branch_shas(self): def get_tag_and_branch_shas(self):
"""Return a list of SHAs of all tags and branches.""" """Return a list of SHAs of all tags and branches."""
tag_shas = self.refs.as_dict('refs/tags/').values() tag_shas = self.refs.as_dict(b'refs/tags/').values()
branch_shas = self.refs.as_dict('refs/heads/').values() branch_shas = self.refs.as_dict(b'refs/heads/').values()
return tag_shas + branch_shas return set(tag_shas) | set(branch_shas)
def history(self, commit, path=None, max_commits=None, skip=0): def history(self, commit, path=None, max_commits=None, skip=0):
"""Return a list of all commits that affected `path`, starting at branch """Return a list of all commits that affected `path`, starting at branch
......
pytest pytest
requests requests
python-ctags; python_version < '3' # not supported on Python 3 python-ctags3
mock; python_version < '3' mock; python_version < '3'
...@@ -13,9 +13,6 @@ import requests.auth ...@@ -13,9 +13,6 @@ import requests.auth
from .utils import * from .utils import *
xfail_py3 = pytest.mark.xfail(sys.version_info[0] >= 3, reason="not supported on Python 3")
def test_htdigest_file_without_smarthttp_or_require_browser_auth(): def test_htdigest_file_without_smarthttp_or_require_browser_auth():
with pytest.raises(ValueError): with pytest.raises(ValueError):
klaus.make_app([], None, htdigest_file=object()) klaus.make_app([], None, htdigest_file=object())
...@@ -84,14 +81,14 @@ test_ctags_disabled = options_test( ...@@ -84,14 +81,14 @@ test_ctags_disabled = options_test(
{}, {},
{'ctags_tags_and_branches': False, 'ctags_all': False} {'ctags_tags_and_branches': False, 'ctags_all': False}
) )
test_ctags_tags_and_branches = xfail_py3(options_test( test_ctags_tags_and_branches = options_test(
{'ctags_policy': 'tags-and-branches'}, {'ctags_policy': 'tags-and-branches'},
{'ctags_tags_and_branches': True, 'ctags_all': False} {'ctags_tags_and_branches': True, 'ctags_all': False}
)) )
test_ctags_all = xfail_py3(options_test( test_ctags_all = options_test(
{'ctags_policy': 'ALL'}, {'ctags_policy': 'ALL'},
{'ctags_tags_and_branches': True, 'ctags_all': True} {'ctags_tags_and_branches': True, 'ctags_all': True}
)) )
# Reach # Reach
...@@ -155,6 +152,7 @@ def ctags_all(): ...@@ -155,6 +152,7 @@ def ctags_all():
def _ctags_enabled(ref, filename): def _ctags_enabled(ref, filename):
response = requests.get(UNAUTH_TEST_REPO_URL + "blob/%s/%s" % (ref, filename)) response = requests.get(UNAUTH_TEST_REPO_URL + "blob/%s/%s" % (ref, filename))
assert response.status_code == 200, response.text
href = '<a href="/%sblob/%s/%s#L-1">' % (TEST_REPO_URL, ref, filename) href = '<a href="/%sblob/%s/%s#L-1">' % (TEST_REPO_URL, ref, filename)
return href in response.text return href in response.text
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment