def testOverrideUrl(self): correctUrl = 'https://hg.mozilla.org/other_repo/json-pushes?version=2&full=1&startID=42' poller = hgpoller.BaseHgPoller( hgURL='https://hg.mozilla.org', branch='mozilla-central', pushlogUrlOverride='https://hg.mozilla.org/other_repo/json-pushes?version=2&full=1') poller.lastPushID = 42 url = poller._make_url() self.failUnlessEqual(url, correctUrl)
def testTipsOnlyWithLastPushID(self): # there's two possible correct URLs in this case correctUrl = 'https://hg.mozilla.org/releases/mozilla-1.9.1/json-pushes?version=2&full=1&startID=42&tipsonly=1' poller = hgpoller.BaseHgPoller(hgURL='https://hg.mozilla.org', branch='releases/mozilla-1.9.1', tipsOnly=True) poller.lastPushID = 42 url = poller._make_url() self.failUnlessEqual(url, correctUrl)
def testUrlWithUnicodeLastChangeset(self): correctUrl = 'https://hg.mozilla.org/mozilla-central/json-pushes?full=1&fromchange=123456' poller = hgpoller.BaseHgPoller(hgURL='https://hg.mozilla.org', branch='mozilla-central') poller.lastChangeset = u'123456' url = poller._make_url() self.failUnlessEqual(url, correctUrl) self.failUnless(isinstance(url, str))
def testOverrideUrl(self): correctUrl = 'https://hg.mozilla.org/other_repo/json-pushes?full=1&fromchange=123456' poller = hgpoller.BaseHgPoller( hgURL='https://hg.mozilla.org', branch='mozilla-central', pushlogUrlOverride= 'https://hg.mozilla.org/other_repo/json-pushes?full=1') poller.lastChangeset = '123456' url = poller._make_url() self.failUnlessEqual(url, correctUrl)
def testTipsOnlyWithLastChangeset(self): # there's two possible correct URLs in this case correctUrls = [ 'https://hg.mozilla.org/releases/mozilla-1.9.1/json-pushes?full=1&fromchange=123456&tipsonly=1', 'https://hg.mozilla.org/releases/mozilla-1.9.1/json-pushes?full=1&tipsonly=1&fromchange=123456' ] poller = hgpoller.BaseHgPoller(hgURL='https://hg.mozilla.org', branch='releases/mozilla-1.9.1', tipsOnly=True) poller.lastChangeset = '123456' url = poller._make_url() self.failUnlessIn(url, correctUrls)
def testSimpleUrl(self): correctUrl = 'https://hg.mozilla.org/mozilla-central/json-pushes?version=2&full=1' poller = hgpoller.BaseHgPoller( hgURL='https://hg.mozilla.org', branch='mozilla-central') url = poller._make_url() self.failUnlessEqual(url, correctUrl)