Commit d394e294 authored by Michal Čihař's avatar Michal Čihař

Add tests for gihub repository using fake hub command

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 30a9de77
#!/bin/sh
# Fake hub implementation for use in testsuite
case "$1" in
pull-request) exit 0;;
fork) exit 0;;
esac
git "$@"
......@@ -20,7 +20,8 @@
from weblate.trans.tests.test_models import RepoTestCase
from weblate.trans.vcs import GitRepository, HgRepository, \
RepositoryException, GitWithGerritRepository
RepositoryException, GitWithGerritRepository, GithubRepository
from weblate.trans.tests.utils import get_test_file
from django.test import TestCase
import tempfile
......@@ -29,6 +30,12 @@ import os.path
import datetime
class GithubFakeRepository(GithubRepository):
_is_supported = None
_version = None
_cmd = get_test_file('hub')
class GitTestRepository(GitRepository):
_is_supported = None
_version = None
......@@ -299,6 +306,12 @@ class VCSGerritTest(VCSGitTest):
_branch = 'master'
class VCSGithubTest(VCSGitTest):
_class = GithubFakeRepository
_vcs = 'git'
_branch = 'master'
class VCSHgTest(VCSGitTest):
"""
Mercurial repository testing.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment