class TestLaunchpad(TrackerTest): pytestmark = pytest.mark.skipif(str('launchpadlib is None')) name = 'launchpad' default_tracker_config = TrackerConfig('inkscape') tracker_config = { 'wrong project': TrackerConfig('foo'), 'invalid': TrackerConfig('eject (Ubuntu)') } issues = { 'closed': Issue('647789', title='tries to install file(s) outside of ' './configure\'s --prefix', closed=True, url='https://bugs.launchpad.net/bugs/647789'), 'invalid': Issue('173307', closed=True, title='All users should be able to eject CDs and ' 'removable media', url='https://bugs.launchpad.net/bugs/173307'), 'wrong project': '1000', 'no issue': '1000000', }
class TestJira(TrackerTest): name = 'jira' issues = { 'resolved': Issue('SHERPA-15', closed=True, title='Breadcrumbs and ' 'page title missing from admin screens', url='https://studio.atlassian.com/browse/SHERPA-15'), } tracker_config = { 'resolved': TrackerConfig('Sherpa', 'https://studio.atlassian.com'), 'open': TrackerConfig('Pyogp', 'https://jira.secondlife.com'), } confoverrides = dict(issuetracker_issue_pattern=r'#([A-Z]+-\d+)') @pytest.mark.with_content('#FOO-15') def test_no_url(self, app): """ Test that the jira tracker fails with a ValueError, if no URL was configured. """ with pytest.raises(ValueError) as excinfo: app.build() assert str(excinfo.value) == 'URL required'
class TestGoogleCode(TrackerTest): name = 'google code' default_tracker_config = TrackerConfig('pytox') tracker_config = {'no project': TrackerConfig('foobar')} PYTOX_URL = 'http://code.google.com/p/pytox/issues/detail?id={0}' issues = { 'fixed': Issue(id='2', closed=True, url=PYTOX_URL.format('2'), title='Hudson exists with SUCCESS status even if tox ' 'failed with ERROR'), 'invalid': Issue(id='5', title='0.7: "error: File exists"', closed=True, url=PYTOX_URL.format('5')), 'wontfix': Issue(id='6', title='Copy modules from site packages', closed=True, url=PYTOX_URL.format('6')), 'no issue': '1000', 'no project': '1', }
class TestBitBucket(ScopedProjectTrackerTest): name = 'bitbucket' default_tracker_config = TrackerConfig('birkenfeld/sphinx') tracker_config = {'no project': TrackerConfig('lunar/foobar')} SPHINX_URL = 'https://bitbucket.org/birkenfeld/sphinx/issue/{0}/' issues = { 'resolved': Issue(id='478', closed=True, url=SPHINX_URL.format('478'), title='Adapt py:decorator from Python docs'), 'invalid': Issue(id='327', closed=True, url=SPHINX_URL.format('327'), title='Spaces at the end of console messages'), 'duplicate': Issue(id='733', closed=True, url=SPHINX_URL.format('733'), title='byte/str conversion fails on Python 3.2'), 'no project': '10', 'no issue': '10000' }
class TestDebian(TrackerTest): pytestmark = pytest.mark.skipif(b'debianbts is None') name = 'debian' tracker_config = {'fixed': TrackerConfig('ldb-tools'), 'no project': TrackerConfig('release.debian.org')} DEBIAN_URL = 'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug={0}' issues = { 'fixed': Issue(id='584227', title='ldb-tools: missing ldb(7) manpage', closed=True, url=DEBIAN_URL.format('584227')), 'no project': '1', }
class TestGitHub(ScopedProjectTrackerTest): name = 'github' default_tracker_config = TrackerConfig('lunaryorn/pyudev') tracker_config = {'no project': TrackerConfig('lunaryorn/foobar')} issues = { 'closed': Issue(id='2', title=u'python 3 support', closed=True, url='https://github.com/lunaryorn/pyudev/issues/2'), 'no project': '10', 'no issue': '1000', }
def test_tracker_config_project_and_url(): """ Test TrackerConfig constructor with a project and url. """ tracker_config = TrackerConfig('eggs', 'http://example.com') assert tracker_config.project == 'eggs' assert tracker_config.url == 'http://example.com'
class TestLaunchpad(TrackerTest): pytestmark = pytest.mark.skipif(b'launchpadlib is None') name = 'launchpad' default_tracker_config = TrackerConfig('inkscape') tracker_config = {'wrong project': TrackerConfig('foo'), 'invalid': TrackerConfig('null')} issues = { 'closed': Issue('647789', title='tries to install file(s) outside of ' './configure\'s --prefix', closed=True, url='https://bugs.launchpad.net/bugs/647789'), 'invalid': Issue('1000', closed=True, title='There are too many bug reports in Malone', url='https://bugs.launchpad.net/bugs/1000'), 'wrong project': '1000', 'no issue': '1000000', }
def test_tracker_config_trailing_slash(): """ Test that the constructor removes trailing slashes from the url. """ tracker_config = TrackerConfig('eggs', 'http://example.com//') assert tracker_config.url == 'http://example.com'
def test_tracker_config_only_project(): """ Test TrackerConfig constructor with a project only. """ tracker_config = TrackerConfig('eggs') assert tracker_config.project == 'eggs'