Changeset 73950 in webkit


Ignore:
Timestamp:
Dec 13, 2010 12:36:22 PM (13 years ago)
Author:
eric@webkit.org
Message:

2010-12-13 Eric Seidel <eric@webkit.org>

Unreviewed.

Teach webkit-patch how to search bugzilla
https://bugs.webkit.org/show_bug.cgi?id=50500

webkit-patch bug-search fails when there is only one result.
Turns out we needed a bit more logic in our result count parsing code.

  • Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
  • Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r73938 r73950  
     12010-12-13  Eric Seidel  <eric@webkit.org>
     2
     3        Unreviewed.
     4
     5        Teach webkit-patch how to search bugzilla
     6        https://bugs.webkit.org/show_bug.cgi?id=50500
     7
     8        webkit-patch bug-search fails when there is only one result.
     9        Turns out we needed a bit more logic in our result count parsing code.
     10
     11        * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
     12        * Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py:
     13
    1142010-12-13  Antti Koivisto  <antti@apple.com>
    215
  • trunk/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py

    r73823 r73950  
    8282    def _parse_result_count(self, results_page):
    8383        result_count_text = BeautifulSoup(results_page).find(attrs={'class': 'bz_result_count'}).string
    84         result_count_parts = result_count_text.split(" ")
     84        result_count_parts = result_count_text.strip().split(" ")
    8585        if result_count_parts[0] == "Zarro":
    8686            return 0
     87        if result_count_parts[0] == "One":
     88            return 1
    8789        return int(result_count_parts[0])
    8890
  • trunk/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py

    r73688 r73950  
    357357        self._assert_result_count(queries, '<span class="bz_result_count">314 bugs found.</span><span class="bz_result_count">314 bugs found.</span>', 314)
    358358        self._assert_result_count(queries, '<span class="bz_result_count">Zarro Boogs found.</span>', 0)
     359        self._assert_result_count(queries, '<span class="bz_result_count">\n \nOne bug found.</span>', 1)
    359360        self.assertRaises(Exception, queries._parse_result_count, ['Invalid'])
    360361
Note: See TracChangeset for help on using the changeset viewer.