[CalendarServer-changes] [7970] CalendarServer/branches/users/glyph/imip-and-admin-html/ calendarserver/webadmin/test/test_resource.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Aug 11 21:53:24 PDT 2011


Revision: 7970
          http://trac.macosforge.org/projects/calendarserver/changeset/7970
Author:   glyph at apple.com
Date:     2011-08-11 21:53:24 -0700 (Thu, 11 Aug 2011)
Log Message:
-----------
test for no-proxies-found message.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/test/test_resource.py

Modified: CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/test/test_resource.py
===================================================================
--- CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/test/test_resource.py	2011-08-12 04:53:11 UTC (rev 7969)
+++ CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/test/test_resource.py	2011-08-12 04:53:24 UTC (rev 7970)
@@ -161,7 +161,9 @@
     @inlineCallbacks
     def test_proxySearch(self):
         """
-        Test for searching for a proxy.
+        When the user searches for a proxy, the results are displayed in a
+        table, in a form that will allow them to submit it to add new read or
+        write proxies.
         """
         self.expectSomeRecords()
         self.resource.getResourceById = partial(FakePrincipalResource, self)
@@ -183,9 +185,34 @@
             [gatherTextNodes(cell) for cell in firstRowCells[1:]],
             ["User", "bob", "bob at example.com, bob at other.example.com", ""]
         )
+        self.assertNotIn(
+            "No matches found for proxy resource bob",
+            gatherTextNodes(document)
+        )
 
 
     @inlineCallbacks
+    def test_noProxySearch(self):
+        """
+        When no results 
+        """
+        self.resource.getResourceById = partial(FakePrincipalResource, self)
+        self.expectRecordSearch("bob", [])
+        document = yield self.renderPage(dict(resourceId=["qux"],
+                                              proxySearch=["bob"]))
+        self.assertEquals(
+            document.getElementById("txt_proxySearch").getAttribute("value"),
+            "bob"
+        )
+        proxyAddForm = document.getElementById("frm_proxyAdd")
+        self.assertIdentical(proxyAddForm, None)
+        self.assertIn(
+            "No matches found for proxy resource bob",
+            gatherTextNodes(document)
+        )
+
+
+    @inlineCallbacks
     def test_noResourceFound(self):
         """
         Searching for resources which don't exist should result in an
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110811/3273ebab/attachment.html>


More information about the calendarserver-changes mailing list