Modified: trunk/Tools/ChangeLog (92513 => 92514)
--- trunk/Tools/ChangeLog 2011-08-05 21:07:50 UTC (rev 92513)
+++ trunk/Tools/ChangeLog 2011-08-05 21:09:48 UTC (rev 92514)
@@ -1,3 +1,12 @@
+2011-08-05 Dimitri Glazkov <[email protected]>
+
+ Garden-o-matic updateexpectations needs a unit test.
+ https://bugs.webkit.org/show_bug.cgi?id=65780
+
+ Reviewed by Adam Barth.
+
+ * Scripts/webkitpy/tool/servers/gardeningserver_unittest.py: Added unit test.
+
2011-08-05 Anders Carlsson <[email protected]>
Future proof an Objective-C test
Modified: trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py (92513 => 92514)
--- trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py 2011-08-05 21:07:50 UTC (rev 92513)
+++ trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py 2011-08-05 21:09:48 UTC (rev 92514)
@@ -51,7 +51,11 @@
class TestGardeningHTTPRequestHandler(GardeningHTTPRequestHandler):
def __init__(self, server):
self.server = server
+ self.body = None
+ def _read_entity_body(self):
+ return self.body if self.body else ''
+
def _serve_text(self, text):
print "== Begin Response =="
print text
@@ -64,9 +68,10 @@
class GardeningServerTest(unittest.TestCase):
- def _post_to_path(self, path, expected_stderr=None, expected_stdout=None):
+ def _post_to_path(self, path, body=None, expected_stderr=None, expected_stdout=None):
handler = TestGardeningHTTPRequestHandler(MockServer())
handler.path = path
+ handler.body = body
OutputCapture().assert_outputs(self, handler.do_POST, expected_stderr=expected_stderr, expected_stdout=expected_stdout)
def test_rollout(self):
@@ -83,3 +88,8 @@
expected_stderr = "MOCK run_command: ['echo', 'optimize-baselines', 'user-scripts/another-test.html'], cwd=/mock-checkout\n"
expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
self._post_to_path("/optimizebaselines?test=user-scripts/another-test.html", expected_stderr=expected_stderr, expected_stdout=expected_stdout)
+
+ def test_updateexpectations(self):
+ expected_stderr = ""
+ expected_stdout = "FailureInfoList: []\n== Begin Response ==\nsuccess\n== End Response ==\n"
+ self._post_to_path("/updateexpectations", body="[]", expected_stderr=expected_stderr, expected_stdout=expected_stdout)