bodhi/tests
by Luke Macken
bodhi/tests/test_controllers.py | 2 --
1 file changed, 2 deletions(-)
New commits:
commit 1b8644f9203b75a27e0107e6f6c9b5ec682838e6
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 28 16:37:09 2010 -0500
Remove a FIXME that I figured it out already...
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 4beb656..d4ba4a8 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1890,8 +1890,6 @@ class TestControllers(testutil.DBTest):
assert u'·' in body.decode('utf-8')
# Try throwing it at the root controller directly
- # FIXME: figure out how to authenticate properly when calling
- # controllers directly
testutil.set_identity_user(User.select()[0])
try:
testutil.call(cherrypy.root.save, **{'stable_karma': 3, 'edited': False, 'builds': [u'TurboGears2-2.0.3-1.fc7'], 'autokarma': False, 'inheritance': False, 'suggest_reboot': False, 'notes': u'\xb7', 'bugs': '1', 'unstable_karma': -3, 'type_': u'bugfix', 'close_bugs': False})
14 years, 1 month
5 commits - bodhi/controllers.py bodhi/tests bodhi/validators.py
by Luke Macken
bodhi/controllers.py | 18 ++++++++++++++++--
bodhi/tests/test_controllers.py | 32 ++++++++++++++++++++++++++++++++
bodhi/tests/test_model.py | 8 +++++++-
bodhi/validators.py | 6 ++++--
4 files changed, 59 insertions(+), 5 deletions(-)
New commits:
commit bbe533cf2396107a5990664bb53faeadd73d6ec2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 28 16:00:04 2010 -0500
Make our AutoCompleteValidator handle getting a list of builds
diff --git a/bodhi/validators.py b/bodhi/validators.py
index 1dda145..5e3f221 100644
--- a/bodhi/validators.py
+++ b/bodhi/validators.py
@@ -37,13 +37,15 @@ class AutoCompleteValidator(validators.Schema):
def _to_python(self, value, state):
tokens = []
- if type(value) in (str, unicode):
+ if isinstance(value, basestring):
tokens = value.split()
- elif type(value) == dict:
+ elif isinstance(value, dict):
if isinstance(value['text'], list):
tokens = value['text']
else:
tokens = [value['text']]
+ elif isinstance(value, (list, tuple)):
+ tokens = value
results = []
for token in tokens:
if token:
commit b1cb2989e3b668e712830b4eea082d0bf931c68c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 28 15:59:26 2010 -0500
Add a couple of utf-8/unicode related tests
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 3df6e2f..4beb656 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1866,3 +1866,35 @@ class TestControllers(testutil.DBTest):
refresh_metrics()
testutil.create_request('/updates/metrics/', method='GET')
assert 'flot' in cherrypy.response.body[0]
+
+ def test_bullets(self):
+ session = login()
+ f7 = create_release()
+ params = {
+ 'notes' : '\xc2\xb7',
+ 'builds' : 'TurboGears-1.0.2.2-2.fc7',
+ 'type_' : 'bugfix',
+ 'bugs' : '1',
+ 'cves' : '',
+ }
+ #testutil.capture_log(['bodhi.controllers', 'bodhi.util', 'bodhi.model'])
+ self.save_update(params, session)
+ #logs = testutil.get_log()
+ #assert False, logs
+ update = PackageUpdate.byTitle(params['builds'])
+ assert update.notes == u'\xb7'
+ assert update.notes.encode('utf-8') == '\xc2\xb7'
+ testutil.create_request('/updates/' + params['builds'])
+ body = cherrypy.response.body[0]
+ assert '\xc2\xb7' in body
+ assert u'·' in body.decode('utf-8')
+
+ # Try throwing it at the root controller directly
+ # FIXME: figure out how to authenticate properly when calling
+ # controllers directly
+ testutil.set_identity_user(User.select()[0])
+ try:
+ testutil.call(cherrypy.root.save, **{'stable_karma': 3, 'edited': False, 'builds': [u'TurboGears2-2.0.3-1.fc7'], 'autokarma': False, 'inheritance': False, 'suggest_reboot': False, 'notes': u'\xb7', 'bugs': '1', 'unstable_karma': -3, 'type_': u'bugfix', 'close_bugs': False})
+ except cherrypy._cperror.HTTPRedirect, e:
+ assert e.status == 303
+ assert e.urls[0] == u'/updates/TurboGears2-2.0.3-1.fc7'
diff --git a/bodhi/tests/test_model.py b/bodhi/tests/test_model.py
index 2ae4fd0..56f5775 100644
--- a/bodhi/tests/test_model.py
+++ b/bodhi/tests/test_model.py
@@ -581,11 +581,17 @@ class TestPackageUpdate(testutil.DBTest):
update.release = self._get_epel_release()
assert update.release.testing_tag == 'dist-5E-epel-testing'
- def test_epel_testing_tag_property(self):
+ def test_epel_stable_tag_property(self):
update = self.get_update(name='TurboGears-1.0.2.2-2.el5')
update.release = self._get_epel_release()
assert update.release.stable_tag == 'dist-5E-epel'
+ def test_bullets_in_notes(self):
+ update = self.get_update(name='foo-1.2.3-4')
+ update.notes = u'\xb7'
+ u = PackageUpdate.byTitle('foo-1.2.3-4')
+ assert u.notes == u'\xb7'
+
def test_utf8_email(self):
update = self.get_update(name='TurboGears-1.0.2.2-2.fc7')
bug = self.get_bug()
commit aaab0f0055625f7426173767e938219abeaecb46
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 28 15:59:08 2010 -0500
Handle the edge case where no updates are created in our save() method
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index b1c3952..85f2a29 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -927,7 +927,10 @@ class Root(controllers.RootController):
updates=updates, num_items=0,
title='Updates sucessfully created!')
else:
- raise redirect(updates[0].get_url())
+ if updates:
+ raise redirect(updates[0].get_url())
+ else:
+ raise redirect('/')
@expose(template='bodhi.templates.list')
@paginate('updates', limit=20, max_limit=20)
commit 600fb7981c95d7e1f9c4cd7f3e518d00261590cd
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 28 15:58:45 2010 -0500
Encode to utf-8 before we pass anything to SQLObject...
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index ebaa8dc..b1c3952 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -799,6 +799,15 @@ class Root(controllers.RootController):
# Create or modify the necessary PackageUpdate objects
for release, builds in releases.items():
+ try:
+ # Encode our unicode strings to UTF-8 before they hit SQLObject
+ # This has fixed numerous tickets, such as #288
+ notes = notes.encode('utf-8', 'replace')
+ type_ = type_.encode('utf8', 'replace')
+ except Exception, e:
+ log.exception(e)
+ log.error('Unable to convert our update to utf-8; passing '
+ 'unicode strings to SQLObject.')
if edited:
update = edited
log.debug("Editing update %s" % edited.title)
@@ -815,7 +824,6 @@ class Root(controllers.RootController):
build.destroySelf()
else:
try:
- type_ = type_.encode('utf8') # hack, for ticket #288
update = PackageUpdate(title=','.join(builds),
release=release,
submitter=identity.current.user_name,
commit 4a966d9d050c046bce9266b763acafef6633d186
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 28 15:58:11 2010 -0500
Have our save() method handle empty build lists.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 0d60f84..ebaa8dc 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -548,6 +548,9 @@ class Root(controllers.RootController):
}
# Basic sanity checks
+ if not builds:
+ flash_log("Error: Didn't receive any builds")
+ raise InvalidUpdateException(params)
if type_ not in config.get('update_types'):
flash_log('Unknown update type: %s. Valid types are: %s' % (
type_, config.get('update_types')))
14 years, 1 month
Duplicate IDs
by David Kaylor
I package the program Tasque and have a problem with an update I pushed to
Bodhi. It was assigned the same ID as another package (FEDORA-2010-1380).
Clicking tasque-0.1.9-2.fc13 on
https://admin.fedoraproject.org/updates/search/tasque will take you to an
update for libsepol. Is there anything I can do to move this update forward?
Thanks,
Dave
14 years, 2 months
bodhi/tools
by Josh Boyer
bodhi/tools/client.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
New commits:
commit 7d2df39e8c69d4cf011cffe529104e31cb2a4f8b
Author: Josh Boyer <jwboyer(a)hansolo.jdub.homelinux.org>
Date: Wed Feb 24 08:20:10 2010 -0500
Only filter Stable updates via --push-type
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index 0a88816..d4b3677 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -210,9 +210,14 @@ def main():
if opts.push_type:
fupdates = []
for ptype in opts.push_type:
- fdata = filter(lambda x: x['type'] == ptype,
+ # Filter all testing updates into the set, since
+ # we only want push_type to apply to stable.
+ fdata = filter(lambda x: x['type'] == ptype and x['request'] == 'stable',
data['updates'])
fupdates += fdata
+ fdata = filter(lambda x: x['request'] == 'testing',
+ data['updates'])
+ fupdates += fdata
data['updates'] = fupdates
if opts.push_release:
14 years, 2 months
2 commits - bodhi/model.py bodhi/tests
by Luke Macken
bodhi/model.py | 4 +++
bodhi/tests/test_model.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)
New commits:
commit 59ea15fa1bf40e31dca3dce0dabbfa87be85f79c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 23 11:30:41 2010 -0500
Add a bunch of unit tests to validate our release tag properties
diff --git a/bodhi/model.py b/bodhi/model.py
index bd08b4e..014a1f5 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -80,13 +80,13 @@ class Release(SQLObject):
@property
def testing_tag(self):
- if self.release.locked:
+ if self.locked:
return '%s-updates-testing' % self.stable_tag
return '%s-testing' % self.stable_tag
@property
def stable_tag(self):
- if self.release.locked:
+ if self.locked:
return self.dist_tag
if self.name.startswith('EL'): # EPEL Hack.
return self.dist_tag
diff --git a/bodhi/tests/test_model.py b/bodhi/tests/test_model.py
index ff635eb..2ae4fd0 100644
--- a/bodhi/tests/test_model.py
+++ b/bodhi/tests/test_model.py
@@ -535,6 +535,57 @@ class TestPackageUpdate(testutil.DBTest):
log = testutil.get_log()
assert "[old_pending] Nagging foo(a)bar.com about TurboGears-1.0.2.2-2.fc7" in log
+ def test_pending_tag_property(self):
+ update = self.get_update(name='TurboGears-1.0.2.2-2.fc7')
+ assert update.release.candidate_tag == 'dist-fc7-updates-candidate'
+
+ def test_testing_tag_property(self):
+ update = self.get_update(name='TurboGears-1.0.2.2-2.fc7')
+ assert update.release.testing_tag == 'dist-fc7-updates-testing'
+
+ def test_stable_tag_property(self):
+ update = self.get_update(name='TurboGears-1.0.2.2-2.fc7')
+ assert update.release.stable_tag == 'dist-fc7-updates'
+
+ def test_stable_tag_property_for_pending_release(self):
+ update = self.get_update(name='TurboGears-1.0.2.2-2.fc7')
+ update.release.locked = True
+ assert update.release.stable_tag == 'dist-fc7'
+
+ def test_testing_tag_property_for_pending_release(self):
+ update = self.get_update(name='TurboGears-1.0.2.2-2.fc7')
+ update.release.locked = True
+ assert update.release.testing_tag == 'dist-fc7-updates-testing'
+
+ def test_pending_tag_property_for_pending_release(self):
+ update = self.get_update(name='TurboGears-1.0.2.2-2.fc7')
+ update.release.locked = True
+ assert update.release.candidate_tag == 'dist-fc7-updates-candidate'
+
+ def _get_epel_release(self):
+ rel = Release.select(Release.q.name=='EL5')
+ if rel.count():
+ rel = rel[0]
+ else:
+ rel = Release(name='EL5', long_name='Fedora EPEL 5', id_prefix='FEDORA-EPEL',
+ dist_tag='dist-5E-epel')
+ return rel
+
+ def test_epel_pending_tag_property(self):
+ update = self.get_update(name='TurboGears-1.0.2.2-2.el5')
+ update.release = self._get_epel_release()
+ assert update.release.candidate_tag == 'dist-5E-epel-testing-candidate'
+
+ def test_epel_testing_tag_property(self):
+ update = self.get_update(name='TurboGears-1.0.2.2-2.el5')
+ update.release = self._get_epel_release()
+ assert update.release.testing_tag == 'dist-5E-epel-testing'
+
+ def test_epel_testing_tag_property(self):
+ update = self.get_update(name='TurboGears-1.0.2.2-2.el5')
+ update.release = self._get_epel_release()
+ assert update.release.stable_tag == 'dist-5E-epel'
+
def test_utf8_email(self):
update = self.get_update(name='TurboGears-1.0.2.2-2.fc7')
bug = self.get_bug()
commit 7e83e9510e4e8005d06f35c1f99dd6c9e0d81e4c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 23 11:09:33 2010 -0500
Tweak our PackageUpdate.{stable,testing}_tag properties to work with pending releases
diff --git a/bodhi/model.py b/bodhi/model.py
index 3444b46..bd08b4e 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -80,10 +80,14 @@ class Release(SQLObject):
@property
def testing_tag(self):
+ if self.release.locked:
+ return '%s-updates-testing' % self.stable_tag
return '%s-testing' % self.stable_tag
@property
def stable_tag(self):
+ if self.release.locked:
+ return self.dist_tag
if self.name.startswith('EL'): # EPEL Hack.
return self.dist_tag
else:
14 years, 2 months
bodhi/tests
by Luke Macken
bodhi/tests/test_model.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 7f3339a8deb8abae2bab42b85b86a4dc999e612b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 23 01:37:31 2010 -0500
Get our test suite running again
diff --git a/bodhi/tests/test_model.py b/bodhi/tests/test_model.py
index 03633ff..ff635eb 100644
--- a/bodhi/tests/test_model.py
+++ b/bodhi/tests/test_model.py
@@ -197,8 +197,9 @@ class TestPackageUpdate(testutil.DBTest):
update.status = 'stable'
assert update.get_url() == url(update)
update.assign_id()
- assert update.get_url() == '/%s/%s' % (update.release.name,
- update.updateid)
+ #assert update.get_url() == '/%s/%s' % (update.release.name,
+ # update.updateid)
+ assert update.get_url() == '/%s' % update.title
def test_multibuild(self):
builds = ['yum-3.2.1-1.fc7', 'httpd-2.2.4-4.1.fc7']
14 years, 2 months
bodhi/model.py
by Luke Macken
bodhi/model.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit b1c1c89152346d5f2fb1bb4ed4f87708effc0d7f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 21 15:51:54 2010 -0500
Have PackageUpdate.get_url use titles, until our updateids are reliable
diff --git a/bodhi/model.py b/bodhi/model.py
index 81fe140..3444b46 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -547,11 +547,12 @@ class PackageUpdate(SQLObject):
def get_url(self):
""" Return the relative URL to this update """
path = ['/']
- if self.updateid:
- path.append(self.release.name)
- path.append(self.updateid)
- else:
- path.append(self.title)
+ # Until our update ids are reliable...
+ #if self.updateid:
+ # path.append(self.release.name)
+ # path.append(self.updateid)
+ #else:
+ path.append(self.title)
return join(*path)
def __str__(self):
14 years, 2 months
3 commits - bodhi/controllers.py bodhi/tests bodhi/tools
by Luke Macken
bodhi/controllers.py | 2
bodhi/tests/test_model.py | 2
bodhi/tools/fix_dupe_ids.py | 116 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 119 insertions(+), 1 deletion(-)
New commits:
commit 6fedb6a2b7c9bb7903677f0bb1da017f263dfd87
Merge: 1ce09a7... d438ca5...
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 21 14:49:16 2010 -0500
Merge branch 'master' of git+ssh://git.fedoraproject.org/git/bodhi
commit 1ce09a7fc53479a7781417d3167e1c7bb222a511
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 21 14:47:11 2010 -0500
Get our test suite working again
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 11a980a..0d60f84 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -35,7 +35,7 @@ from turbogears.widgets import DataGrid
try:
from fedora.tg.tg1utils import request_format
except ImportError:
- from fedora.tg.tutil import request_format
+ from fedora.tg.util import request_format
from fedora.tg.controllers import login as fc_login
from fedora.tg.controllers import logout as fc_logout
diff --git a/bodhi/tests/test_model.py b/bodhi/tests/test_model.py
index 1fd6529..03633ff 100644
--- a/bodhi/tests/test_model.py
+++ b/bodhi/tests/test_model.py
@@ -11,6 +11,7 @@ database.set_db_uri("sqlite:///:memory:")
from datetime import datetime, timedelta
from sqlobject import SQLObjectNotFound
from yum.update_md import UpdateMetadata
+from nose.tools import raises
from bodhi.jobs import nagmail
from bodhi.util import rpm_fileheader, get_nvr
@@ -146,6 +147,7 @@ class TestPackageUpdate(testutil.DBTest):
newest.assign_id()
assert newest.updateid == 'FEDORA-2010-10002'
+ @raises(AssertionError) # Ideally, this shouldn't happen, but it does.
def test_duplicate_ids(self):
older = self.get_update(name='nethack-2.5.8-1.fc10')
older.assign_id()
commit cda185bbc2c2a25ecb230a274a3125bed8ff88f9
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sun Feb 21 14:39:18 2010 -0500
Add a nasty script to fix updates with duplicate IDs.
This seems to resolve the issue locally, after running this script twice in a row.
diff --git a/bodhi/tools/fix_dupe_ids.py b/bodhi/tools/fix_dupe_ids.py
new file mode 100644
index 0000000..21d0740
--- /dev/null
+++ b/bodhi/tools/fix_dupe_ids.py
@@ -0,0 +1,116 @@
+#!/usr/bin/python -tt
+"""
+This is a nasty hack to fix updates with duplicate ids.
+"""
+
+import os
+import time
+import cPickle
+
+from datetime import datetime
+from pprint import pprint
+from turbogears.database import PackageHub
+from bodhi.util import load_config
+from bodhi.model import PackageUpdate, Release
+from sqlobject import AND
+
+hub = PackageHub("bodhi")
+__connection__ = hub
+
+def main():
+ load_config()
+ hub.begin()
+
+ print "Finding updates with duplicate IDs..."
+ if os.path.exists('dupes.pickle'):
+ out = file('dupes.pickle')
+ dupes = cPickle.load(out)
+ out.close()
+ highest_fedora = int(file('highest_fedora').read())
+ highest_epel = int(file('highest_epel').read())
+ else:
+ dupes = set()
+ highest_fedora = 0
+ highest_epel = 0
+
+ for update in PackageUpdate.select(PackageUpdate.q.updateid!=None):
+ if '-2010-' in update.updateid:
+ if update.release.id_prefix == 'FEDORA':
+ if update.updateid_int > highest_fedora:
+ highest_fedora = update.updateid_int
+ else:
+ if update.updateid_int > highest_epel:
+ highest_epel = update.updateid_int
+
+ updates = PackageUpdate.select(
+ AND(PackageUpdate.q.updateid == update.updateid,
+ PackageUpdate.q.title != update.title))
+ if updates.count():
+ # Maybe TODO?: ensure these dupes have a date_pushed less tahn update?!
+ # this way, the new ID is based on the oldest update
+ for u in updates:
+ dupes.add(u.title)
+
+ out = file('dupes.pickle', 'w')
+ cPickle.dump(dupes, out)
+ out.close()
+ print "Wrote dupes.pickle"
+
+ file('highest_fedora', 'w').write(str(highest_fedora))
+ file('highest_epel', 'w').write(str(highest_epel))
+
+ # verify what we really found the highest IDs
+ assert PackageUpdate.select(PackageUpdate.q.updateid=='FEDORA-2010-%d' % (highest_fedora + 1)).count() == 0
+ assert PackageUpdate.select(PackageUpdate.q.updateid=='FEDORA-EPEL-2010-%d' % (highest_epel + 1)).count() == 0
+
+ # Should be 740?
+ print "%d dupes" % len(dupes)
+
+ print "Highest FEDORA ID:", highest_fedora
+ print "Highest FEDORA-EPEL ID:", highest_epel
+
+ # Reassign the update IDs on all of our dupes
+ for dupe in dupes:
+ up = PackageUpdate.byTitle(dupe)
+ #print "%s *was* %s" % (up.title, up.updateid)
+ up.updateid = None
+
+ # TODO: save & restore this value after new id assignment?!
+ #up.date_pushed = None
+
+ # Tweak the date_pushed to on the updates with the highest IDs
+ PackageUpdate.select(PackageUpdate.q.updateid=='FEDORA-2010-%d' % highest_fedora).date_pushed = datetime.now()
+ PackageUpdate.select(PackageUpdate.q.updateid=='FEDORA-EPEL-2010-%d' % highest_epel).date_pushed = datetime.now()
+
+ #hub.commit()
+
+
+ for dupe in dupes:
+ up = PackageUpdate.byTitle(dupe)
+ up.assign_id()
+ ups = PackageUpdate.select(PackageUpdate.q.updateid == up.updateid)
+ if ups.count() == 1:
+ print "Still a dupe!!"
+ for update in ups:
+ if update.title == up.title:
+ continue
+ else:
+ if update.title in dupes:
+ print "%s in dupes, yet shares an updateid %s" % (
+ update.title, update.updateid)
+ else:
+ print "%s is not in dupes, but dupes %s" % (
+ update.title, updateid)
+
+ print "Checking to ensure we have no more dupes..."
+ dupes = set()
+ for update in PackageUpdate.select(PackageUpdate.q.updateid != None):
+ updates = PackageUpdate.select(
+ AND(PackageUpdate.q.updateid == update.updateid,
+ PackageUpdate.q.title != update.title))
+ if updates.count():
+ dupes.add(update.title)
+ print "%d dupes (should be 0)" % len(dupes)
+
+if __name__ == '__main__':
+ main()
14 years, 2 months
2 commits - bodhi/widgets.py
by Mathieu Bridon
bodhi/widgets.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit d438ca5ac9e2fda25264faed451c0afae55e85dc
Merge: cf36d86... 46b98f4...
Author: Mathieu Bridon <bochecha(a)fedoraproject.org>
Date: Sat Feb 20 20:04:36 2010 +0100
Merge branch 'master' of ssh://git.fedorahosted.org/git/bodhi
commit cf36d86c8fad22e03f6c8134a0d926f792b5b598
Author: Mathieu Bridon <bochecha(a)fedoraproject.org>
Date: Sat Feb 20 19:55:33 2010 +0100
Repel a French invasion in the code.
diff --git a/bodhi/widgets.py b/bodhi/widgets.py
index 87141af..eaa8706 100644
--- a/bodhi/widgets.py
+++ b/bodhi/widgets.py
@@ -102,7 +102,7 @@ class NewUpdateForm(Form):
attrs={'title' : 'Advisory Notes - <p>Some optional details '
'about this update that will appear in '
'the notice.</p>'
- '<p><strong>Exemple:</strong><br />'
+ '<p><strong>Example:</strong><br />'
'This is an update that fixes problems with '
'**<strong>connecting to a share</strong>**.</p>'
'<p>The following things *<em>break</em>*:</p>'
14 years, 2 months
bodhi/tests
by Luke Macken
bodhi/tests/test_model.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
New commits:
commit 46b98f4fea67f9df75314751877beccfbb1552d5
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Feb 20 14:02:38 2010 -0500
Write a unit test that reproduces our duplicate ID issue...
diff --git a/bodhi/tests/test_model.py b/bodhi/tests/test_model.py
index baa63c8..1fd6529 100644
--- a/bodhi/tests/test_model.py
+++ b/bodhi/tests/test_model.py
@@ -146,6 +146,23 @@ class TestPackageUpdate(testutil.DBTest):
newest.assign_id()
assert newest.updateid == 'FEDORA-2010-10002'
+ def test_duplicate_ids(self):
+ older = self.get_update(name='nethack-2.5.8-1.fc10')
+ older.assign_id()
+ assert older.updateid == 'FEDORA-2010-0001', older.updateid
+
+ newest = self.get_update(name='TurboGears-2.5.8-1.fc10')
+ newest.assign_id()
+ assert newest.updateid == 'FEDORA-2010-0002', newest.updateid
+
+ # Now, pretend 'older' goes from testing->stable, and the date_pushed changes
+ older.date_pushed = older.date_pushed + timedelta(days=7)
+
+ up = self.get_update(name='kernel-2.6.9er-1.fc10')
+ up.status = 'testing'
+ up.assign_id()
+ assert up.updateid == 'FEDORA-2010-1003', up.updateid
+
def test_epel_id(self):
""" Make sure we can handle id_prefixes that contain dashes. eg: FEDORA-EPEL """
# Create a normal Fedora update first
14 years, 2 months