[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
eric at webkit.org
eric at webkit.org
Wed Dec 22 15:31:38 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ed4ba09a5ed3e3b7492dc1ff511435599d84ab46
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 5 19:02:30 2010 +0000
2010-11-05 Eric Seidel <eric at webkit.org>
Reviewed by David Levin.
Add QueueStatusServer/__init__.py so others can run the QueueStatusServer tests
https://bugs.webkit.org/show_bug.cgi?id=49032
I wrote this file as part of bug 47847, but I forgot to commit it.
No one else noticed it missing because test-webkitpy knows how
to recover in the case where it can't import QueueStatusServer
(which generally occurs due to not having installed the AppEngine SDK).
* QueueStatusServer/__init__.py: Added.
* QueueStatusServer/model/workitems_unittest.py:
- Remove a test which fails. This was probably landed (by me)
from my other machine, which since this __init__.py was missing
I never noticed the failure and landed this invalid test.
Sadly we can't really test remove_work_item as it depends
on .key() working. .key() will throw unless the object
has already been saved it seems.
This may be a mis-design in our remove_work_item implementation,
but for now, just removing the test.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 1b84051..e257849 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,26 @@
+2010-11-05 Eric Seidel <eric at webkit.org>
+
+ Reviewed by David Levin.
+
+ Add QueueStatusServer/__init__.py so others can run the QueueStatusServer tests
+ https://bugs.webkit.org/show_bug.cgi?id=49032
+
+ I wrote this file as part of bug 47847, but I forgot to commit it.
+ No one else noticed it missing because test-webkitpy knows how
+ to recover in the case where it can't import QueueStatusServer
+ (which generally occurs due to not having installed the AppEngine SDK).
+
+ * QueueStatusServer/__init__.py: Added.
+ * QueueStatusServer/model/workitems_unittest.py:
+ - Remove a test which fails. This was probably landed (by me)
+ from my other machine, which since this __init__.py was missing
+ I never noticed the failure and landed this invalid test.
+ Sadly we can't really test remove_work_item as it depends
+ on .key() working. .key() will throw unless the object
+ has already been saved it seems.
+ This may be a mis-design in our remove_work_item implementation,
+ but for now, just removing the test.
+
2010-11-04 Adam Roben <aroben at apple.com>
Teach check-webkit-style about TestNetscapePlugIn
diff --git a/WebKitTools/QueueStatusServer/__init__.py b/WebKitTools/QueueStatusServer/__init__.py
new file mode 100644
index 0000000..2346c23
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/__init__.py
@@ -0,0 +1,29 @@
+# Required for Python to search this directory for module files
+
+# This __init__.py makes unit testing easier by allowing us to treat the entire server as one big module.
+# This file is only accessed when not on AppEngine itself.
+
+# Make sure that this module will load in that case by including paths to
+# the default Google AppEngine install.
+
+
+def fix_sys_path():
+ import sys
+ import os
+
+ # AppEngine imports a bunch of google-specific modules. Thankfully the dev_appserver
+ # knows how to do the same. Re-use the dev_appserver fix_sys_path logic to import
+ # all the google.appengine.* stuff so we can run under test-webkitpy
+ sys.path.append("/usr/local/google_appengine")
+ import dev_appserver
+ dev_appserver.fix_sys_path()
+
+ # test-webkitpy adds $WEBKIT/WebKitTools to the sys.path and imports
+ # QueueStatusServer to run all the tests. However, when AppEngine runs
+ # our code QueueStatusServer is the root (and thus in the path).
+ # Emulate that here for test-webkitpy so that we can import "model."
+ # not "QueueStatusServer.model.", etc.
+ sys.path.append(os.path.dirname(__file__))
+
+
+fix_sys_path()
diff --git a/WebKitTools/QueueStatusServer/model/workitems.py b/WebKitTools/QueueStatusServer/model/workitems.py
index fae6830..772fc39 100644
--- a/WebKitTools/QueueStatusServer/model/workitems.py
+++ b/WebKitTools/QueueStatusServer/model/workitems.py
@@ -52,6 +52,7 @@ class WorkItems(db.Model, QueuePropertyMixin):
work_items.item_ids.append(attachment_id)
work_items.put()
+ # Because this uses .key() self.is_saved() must be True or this will throw NotSavedError.
def add_work_item(self, attachment_id):
db.run_in_transaction(self._unguarded_add, self.key(), attachment_id)
@@ -63,5 +64,6 @@ class WorkItems(db.Model, QueuePropertyMixin):
work_items.item_ids.remove(attachment_id)
work_items.put()
+ # Because this uses .key() self.is_saved() must be True or this will throw NotSavedError.
def remove_work_item(self, attachment_id):
db.run_in_transaction(self._unguarded_remove, self.key(), attachment_id)
diff --git a/WebKitTools/QueueStatusServer/model/workitems_unittest.py b/WebKitTools/QueueStatusServer/model/workitems_unittest.py
index d53302e..b1ff1d3 100644
--- a/WebKitTools/QueueStatusServer/model/workitems_unittest.py
+++ b/WebKitTools/QueueStatusServer/model/workitems_unittest.py
@@ -40,14 +40,6 @@ class WorkItemsTest(unittest.TestCase):
self.assertEquals(items.display_position_for_attachment(1), 2)
self.assertEquals(items.display_position_for_attachment(3), None)
- def test_remove_work_item(self):
- items = WorkItems()
- items.item_ids = [0, 1, 2]
- items.remove_work_item(0)
- self.assertEqual(items.item_ids, [1, 2])
- items.remove_work_item(4) # Should not throw
- self.assertEqual(items.item_ids, [1, 2])
-
if __name__ == '__main__':
unittest.main()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list