Changeset 51595 in webkit
- Timestamp:
- Dec 2, 2009 2:44:28 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r51593 r51595 1 2009-12-02 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 REGRESSION(51590): style-queue and build-queue think their empty when they are not 6 https://bugs.webkit.org/show_bug.cgi?id=32061 7 8 * Scripts/modules/bugzilla.py: make all id lookups return ints instead of strings. 9 * Scripts/modules/bugzilla_unittest.py: Add and update unit tests to use ints. 10 1 11 2009-12-02 Eric Seidel <eric@webkit.org> 2 12 -
trunk/WebKitTools/Scripts/modules/bugzilla.py
r51590 r51595 96 96 match = re.search("http\://webkit\.org/b/(?P<bug_id>\d+)", message) 97 97 if match: 98 return match.group('bug_id')98 return int(match.group('bug_id')) 99 99 match = re.search(Bugzilla.bug_server_regex + "show_bug\.cgi\?id=(?P<bug_id>\d+)", message) 100 100 if match: 101 return match.group('bug_id')101 return int(match.group('bug_id')) 102 102 return None 103 103 … … 174 174 attachment['is_obsolete'] = (element.has_key('isobsolete') and element['isobsolete'] == "1") 175 175 attachment['is_patch'] = (element.has_key('ispatch') and element['ispatch'] == "1") 176 attachment['id'] = str(element.find('attachid').string)176 attachment['id'] = int(element.find('attachid').string) 177 177 attachment['url'] = self.attachment_url_for_id(attachment['id']) 178 178 attachment['name'] = unicode(element.find('desc').string) … … 218 218 attachments = self.fetch_attachments_from_bug(bug_id) 219 219 for attachment in attachments: 220 if attachment['id'] == attachment_id: 220 # FIXME: Once we have a real Attachment class we shouldn't paper over this possible comparison failure 221 # and we should remove the int() == int() hacks and leave it just ==. 222 if int(attachment['id']) == int(attachment_id): 221 223 self._validate_committer_and_reviewer(attachment) 222 224 return attachment -
trunk/WebKitTools/Scripts/modules/bugzilla_unittest.py
r51464 r51595 30 30 31 31 from modules.committers import CommitterList, Reviewer, Committer 32 from modules.bugzilla import Bugzilla 32 from modules.bugzilla import Bugzilla, parse_bug_id 33 33 34 34 from modules.BeautifulSoup import BeautifulSoup … … 62 62 ''' 63 63 _expected_example_attachment_parsing = { 64 'bug_id' : "100",64 'bug_id' : 100, 65 65 'is_obsolete' : True, 66 66 'is_patch' : True, 67 'id' : "33721",67 'id' : 33721, 68 68 'url' : "https://bugs.webkit.org/attachment.cgi?id=33721", 69 69 'name' : "Fixed whitespace issue", … … 74 74 'committer_email' : 'two@test.com', 75 75 } 76 77 def test_parse_bug_id(self): 78 # FIXME: These would be all better as doctests 79 bugs = Bugzilla() 80 self.assertEquals(12345, parse_bug_id("http://webkit.org/b/12345")) 81 self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345")) 82 self.assertEquals(12345, parse_bug_id(bugs.short_bug_url_for_bug_id(12345))) 83 self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345))) 84 self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345, xml=True))) 85 86 # Our bug parser is super-fragile, but at least we're testing it. 87 self.assertEquals(None, parse_bug_id("http://www.webkit.org/b/12345")) 88 self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&id=12345")) 89 76 90 77 91 def test_attachment_parsing(self):
Note: See TracChangeset
for help on using the changeset viewer.