1
"""Unit tests for the Fedora Hosted hosting service."""
3
from __future__ import unicode_literals
5
from reviewboard.hostingsvcs.testing import HostingServiceTestCase
8
class FedoraHosted(HostingServiceTestCase):
9
"""Unit tests for the Fedora Hosted hosting service."""
11
service_name = 'fedorahosted'
13
def test_service_support(self):
14
"""Testing FedoraHosted service support capabilities"""
15
self.assertTrue(self.service_class.supports_bug_trackers)
16
self.assertTrue(self.service_class.supports_repositories)
18
def test_get_repository_fields_with_git(self):
19
"""Testing FedoraHosted.get_repository_fields for Git"""
21
self.get_repository_fields(
24
'fedorahosted_repo_name': 'myrepo',
28
'path': 'git://git.fedorahosted.org/git/myrepo.git',
29
'raw_file_url': ('http://git.fedorahosted.org/cgit/myrepo.git/'
30
'blob/<filename>?id=<revision>'),
33
def test_get_repository_fields_with_mercurial(self):
34
"""Testing FedoraHosted.get_repository_fields for Mercurial"""
36
self.get_repository_fields(
39
'fedorahosted_repo_name': 'myrepo',
43
'path': 'http://hg.fedorahosted.org/hg/myrepo/',
44
'mirror_path': 'https://hg.fedorahosted.org/hg/myrepo/',
47
def test_get_repository_fields_with_subversion(self):
48
"""Testing FedoraHosted.get_repository_fields for Subversion"""
50
self.get_repository_fields(
53
'fedorahosted_repo_name': 'myrepo',
57
'path': 'http://svn.fedorahosted.org/svn/myrepo/',
58
'mirror_path': 'https://svn.fedorahosted.org/svn/myrepo/',
61
def test_get_bug_tracker_field(self):
62
"""Testing FedoraHosted.get_bug_tracker_field"""
64
self.service_class.get_bug_tracker_requires_username())
66
self.service_class.get_bug_tracker_field(None, {
67
'fedorahosted_repo_name': 'myrepo',
69
'https://fedorahosted.org/myrepo/ticket/%s')