Skip to content
Permalink
Browse files

Change the development base_address to be localhost.

Most developers are likely to develop by pointing their browsers
at localhost, rather than 0.0.0.0. This commit sets the
base_address to use the name "localhost" by default for new
developers.
  • Loading branch information...
bowlofeggs committed Sep 20, 2016
1 parent 779fb62 commit 0fd5901d9994eb6332c98c197c6ab7311d54b6ad
Showing with 27 additions and 17 deletions.
  1. +16 −14 bodhi/tests/server/functional/test_updates.py
  2. +10 −2 bodhi/tests/server/test_masher.py
  3. +1 −1 development.ini.example
@@ -18,6 +18,7 @@
import textwrap
import time
import mock
import urlparse

from mock import ANY
from nose.tools import eq_
@@ -433,7 +434,6 @@ def test_list_updates(self):
self.assertEquals(len(body['updates']), 1)

alias = u'FEDORA-%s-a3bbe1a8f2' % YEAR
baseurl = 'http://0.0.0.0:6543'

up = body['updates'][0]
self.assertEquals(up['title'], u'bodhi-2.0-1.fc17')
@@ -453,7 +453,7 @@ def test_list_updates(self):
self.assertEquals(up['locked'], True)
self.assertEquals(up['alias'], alias)
self.assertEquals(up['karma'], 1)
self.assertEquals(up['url'], '%s/updates/%s' % (baseurl, alias))
self.assertEquals(up['url'], (urlparse.urljoin(config['base_address'], '/updates/%s' % alias)))

def test_list_updates_jsonp(self):
res = self.app.get('/updates/',
@@ -1765,19 +1765,21 @@ def test_obsoletion(self, publish, *args):

# Check for the comment multiple ways
# Note that caveats above don't support markdown, but comments do.
self.assertEquals(r['comments'][-1]['text'],
u'This update has obsoleted [bodhi-2.0.0-2.fc17]'
'(http://0.0.0.0:6543/updates/FEDORA-2016-033713b73b), '
'and has inherited its bugs and notes.')
expected_comment = (
u'This update has obsoleted [bodhi-2.0.0-2.fc17]({}), '
u'and has inherited its bugs and notes.')
expected_comment = expected_comment.format(
urlparse.urljoin(config['base_address'], '/updates/FEDORA-2016-033713b73b'))
self.assertEquals(r['comments'][-1]['text'], expected_comment)
publish.assert_called_with(
topic='update.request.testing', msg=mock.ANY)

up = self.db.query(Update).filter_by(title=nvr).one()
self.assertEquals(up.status, UpdateStatus.obsolete)
self.assertEquals(up.comments[-1].text,
u'This update has been obsoleted by '
'[bodhi-2.0.0-3.fc17](http://0.0.0.0:6543/'
'updates/FEDORA-2016-53345602d5).')
expected_comment = u'This update has been obsoleted by [bodhi-2.0.0-3.fc17]({}).'
expected_comment = expected_comment.format(
urlparse.urljoin(config['base_address'], '/updates/FEDORA-2016-53345602d5'))
self.assertEquals(up.comments[-1].text, expected_comment)

@mock.patch(**mock_valid_requirements)
@mock.patch('bodhi.server.notifications.publish')
@@ -1861,10 +1863,10 @@ def test_push_to_stable_for_obsolete_update(self, publish, *args):

up = self.db.query(Update).filter_by(title=nvr).one()
self.assertEquals(up.status, UpdateStatus.obsolete)
self.assertEquals(up.comments[-1].text,
u'This update has been obsoleted by '
'[bodhi-2.0.0-3.fc17](http://0.0.0.0:6543/'
'updates/FEDORA-2016-53345602d5).')
expected_comment = u'This update has been obsoleted by [bodhi-2.0.0-3.fc17]({}).'
expected_comment = expected_comment.format(
urlparse.urljoin(config['base_address'], '/updates/FEDORA-2016-53345602d5'))
self.assertEquals(up.comments[-1].text, expected_comment)

# Check Push to Stable button for obsolete update
id = 'bodhi-2.0.0-2.fc17'
@@ -15,6 +15,7 @@
import os
import mock
import time
import urlparse
import json
import shutil
import unittest
@@ -781,8 +782,15 @@ def test_absent_gating(self, cmd, publish, *args):
@mock.patch('bodhi.server.bugs.bugtracker.on_qa')
def test_modify_testing_bugs(self, on_qa, modified, *args):
self.masher.consume(self.msg)
on_qa.assert_called_once_with(12345,
u'bodhi-2.0-1.fc17 has been pushed to the Fedora 17 testing repository. If problems still persist, please make note of it in this bug report.\nSee https://fedoraproject.org/wiki/QA:Updates_Testing for\ninstructions on how to install test updates.\nYou can provide feedback for this update here: http://0.0.0.0:6543/updates/FEDORA-2016-a3bbe1a8f2')

expected_message = (
u'bodhi-2.0-1.fc17 has been pushed to the Fedora 17 testing repository. If problems '
u'still persist, please make note of it in this bug report.\nSee '
u'https://fedoraproject.org/wiki/QA:Updates_Testing for\ninstructions on how to '
u'install test updates.\nYou can provide feedback for this update here: {}')
expected_message = expected_message.format(
urlparse.urljoin(config['base_address'], '/updates/FEDORA-2016-a3bbe1a8f2'))
on_qa.assert_called_once_with(12345, expected_message)

@mock.patch(**mock_taskotron_results)
@mock.patch('bodhi.server.consumers.masher.MasherThread.update_comps')
@@ -123,7 +123,7 @@ fedora_epel_testing_master_repomd = https://download.fedoraproject.org/pub/epel/

## The base url of this application
## Used as the <base/> tag in the master template.
base_address = http://0.0.0.0:6543/
base_address = http://localhost:6543/
#base_address = https://admin.stg.fedoraproject.org/updates/

## Supported update types

0 comments on commit 0fd5901

Please sign in to comment.
You can’t perform that action at this time.