Fix webkitpy unit tests after 95547 and 95549
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 23:53:22 +0000 (23:53 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 23:53:22 +0000 (23:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68483

Patch by Leandro Pereira <leandro@profusion.mobi> on 2011-09-20
Reviewed by Adam Barth.

Fix tests for ChangeLog.touched_files() and ChangeLog.parse_entries_from_file().

* Scripts/webkitpy/common/checkout/changelog_unittest.py: While testing
parse_entries_from_file(), use StringIO and entry.reviewer_text().
While testing parse_latest_entry_from_file(), expect the correct
touched_files() list.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95583 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py

index a1a176d..7a6b94c 100644 (file)
@@ -1,3 +1,17 @@
+2011-09-20  Leandro Pereira  <leandro@profusion.mobi>
+
+        Fix webkitpy unit tests after 95547 and 95549
+        https://bugs.webkit.org/show_bug.cgi?id=68483
+
+        Reviewed by Adam Barth.
+        
+        Fix tests for ChangeLog.touched_files() and ChangeLog.parse_entries_from_file().
+
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py: While testing
+        parse_entries_from_file(), use StringIO and entry.reviewer_text().
+        While testing parse_latest_entry_from_file(), expect the correct
+        touched_files() list.
+
 2011-09-20  Adam Barth  <abarth@webkit.org>
 
         garden-o-matic makes it hard to compare images when scroll bars appear
index 644e488..26b5f92 100644 (file)
@@ -154,11 +154,12 @@ class ChangeLogTest(unittest.TestCase):
         self.assertEquals(57354, parse_bug_id_from_changelog(commit_text))
 
     def test_parse_log_entries_from_changelog(self):
-        parsed_entries = list(ChangeLog.parse_entries_from_changelog(ChangeLogTest._example_changelog))
+        changelog_file = StringIO(self._example_changelog)
+        parsed_entries = list(ChangeLog.parse_entries_from_file(changelog_file))
         self.assertEquals(len(parsed_entries), 3)
-        self.assertEquals(parsed_entries[0].reviewer(), 'David Levin')
-        self.assertEquals(parsed_entries[1].author_email(), 'ddkilzer@apple.com')
-        self.assertEquals(parsed_entries[2].touched_files(), ['DumpRenderTree/mac/DumpRenderTreeWindow.mm'])
+        self.assertEquals(parsed_entries[0].reviewer_text(), "David Levin")
+        self.assertEquals(parsed_entries[1].author_email(), "ddkilzer@apple.com")
+        self.assertEquals(parsed_entries[2].touched_files(), ["DumpRenderTree/mac/DumpRenderTreeWindow.mm"])
 
     def test_latest_entry_parse(self):
         changelog_contents = u"%s\n%s" % (self._example_entry, self._example_changelog)
@@ -168,7 +169,8 @@ class ChangeLogTest(unittest.TestCase):
         self.assertEquals(latest_entry.author_name(), "Peter Kasting")
         self.assertEquals(latest_entry.author_email(), "pkasting@google.com")
         self.assertEquals(latest_entry.reviewer_text(), u"Tor Arne Vestb\xf8")
-        self.assertEquals(latest_entry.touched_files(), ["Scripts/modules/cpp_style.py", "Scripts/modules/cpp_style_unittest.py"])
+        self.assertEquals(latest_entry.touched_files(), ["DumpRenderTree/win/DumpRenderTree.vcproj", "DumpRenderTree/win/ImageDiff.vcproj", "DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj"])
+
         self.assertTrue(latest_entry.reviewer())  # Make sure that our UTF8-based lookup of Tor works.
 
     def test_latest_entry_parse_single_entry(self):