[CalendarServer-changes] [12957] CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools /shell/test/test_vfs.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 18 13:56:02 PDT 2014


Revision: 12957
          http://trac.calendarserver.org//changeset/12957
Author:   wsanchez at apple.com
Date:     2014-03-18 13:56:02 -0700 (Tue, 18 Mar 2014)
Log Message:
-----------
Disable these tests for now

Modified Paths:
--------------
    CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/shell/test/test_vfs.py

Modified: CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/shell/test/test_vfs.py
===================================================================
--- CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/shell/test/test_vfs.py	2014-03-18 20:48:16 UTC (rev 12956)
+++ CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/shell/test/test_vfs.py	2014-03-18 20:56:02 UTC (rev 12957)
@@ -15,38 +15,70 @@
 # limitations under the License.
 ##
 
-from twisted.trial.unittest import SkipTest
-raise SkipTest("tests broken")
-
-
 from twisted.trial.unittest import TestCase
 from twisted.internet.defer import succeed, inlineCallbacks
 
+try:
+    from twistedcaldav.directory.test.test_xmlfile import XMLFileBase
+except ImportError:
+    from twisted.trial.unittest import SkipTest
+
+    class XMLFileBase(object):
+        @property
+        def service(self):
+            # Make this raise SkipTest also
+            return XMLFileBase
+
+        def __init__(*args, **kwargs):
+            raise SkipTest(
+                "XMLFileBase is gone; this needs to be reimplemented."
+            )
+
+from txdav.common.datastore.test.util import buildStore
+
 from calendarserver.tools.shell.vfs import ListEntry
 from calendarserver.tools.shell.vfs import File, Folder
 from calendarserver.tools.shell.vfs import UIDsFolder
 from calendarserver.tools.shell.terminal import ShellService
-from twistedcaldav.directory.test.test_xmlfile import XMLFileBase
-from txdav.common.datastore.test.util import buildStore
 
+
+
 class TestListEntry(TestCase):
     def test_toString(self):
-        self.assertEquals(ListEntry(None, File  , "thingo").toString(), "thingo")
-        self.assertEquals(ListEntry(None, File  , "thingo", Foo="foo").toString(), "thingo")
-        self.assertEquals(ListEntry(None, Folder, "thingo").toString(), "thingo/")
-        self.assertEquals(ListEntry(None, Folder, "thingo", Foo="foo").toString(), "thingo/")
+        self.assertEquals(
+            ListEntry(None, File, "thingo").toString(),
+            "thingo"
+        )
+        self.assertEquals(
+            ListEntry(None, File, "thingo", Foo="foo").toString(),
+            "thingo"
+        )
+        self.assertEquals(
+            ListEntry(None, Folder, "thingo").toString(),
+            "thingo/"
+        )
+        self.assertEquals(
+            ListEntry(None, Folder, "thingo", Foo="foo").toString(),
+            "thingo/"
+        )
 
 
     def test_fieldNamesImplicit(self):
         # This test assumes File doesn't set list.fieldNames.
         assert not hasattr(File.list, "fieldNames")
 
-        self.assertEquals(set(ListEntry(File(None, ()), File, "thingo").fieldNames), set(("Name",)))
+        self.assertEquals(
+            set(ListEntry(File(None, ()), File, "thingo").fieldNames),
+            set(("Name",))
+        )
 
 
     def test_fieldNamesExplicit(self):
         def fieldNames(fileClass):
-            return ListEntry(fileClass(None, ()), fileClass, "thingo", Flavor="Coconut", Style="Hard")
+            return ListEntry(
+                fileClass(None, ()), fileClass, "thingo",
+                Flavor="Coconut", Style="Hard"
+            )
 
         # Full list
         class MyFile1(File):
@@ -86,14 +118,24 @@
 
         # Name first, rest sorted by field name
         self.assertEquals(
-            tuple(ListEntry(File(None, ()), File, "thingo", Flavor="Coconut", Style="Hard").toFields()),
+            tuple(
+                ListEntry(
+                    File(None, ()), File, "thingo",
+                    Flavor="Coconut", Style="Hard"
+                ).toFields()
+            ),
             ("thingo", "Coconut", "Hard")
         )
 
 
     def test_toFieldsExplicit(self):
         def fields(fileClass):
-            return tuple(ListEntry(fileClass(None, ()), fileClass, "thingo", Flavor="Coconut", Style="Hard").toFields())
+            return tuple(
+                ListEntry(
+                    fileClass(None, ()), fileClass, "thingo",
+                    Flavor="Coconut", Style="Hard"
+                ).toFields()
+            )
 
         # Full list
         class MyFile1(File):
@@ -152,9 +194,11 @@
         Create a L{UIDsFolder}.
         """
         directory = DirectoryStubber(self).service()
-        self.svc = ShellService(store=(yield buildStore(self, None, directoryService=directory)),
-                                directory=directory,
-                                options=None, reactor=None, config=None)
+        self.svc = ShellService(
+            store=(yield buildStore(self, None, directoryService=directory)),
+            directory=directory,
+            options=None, reactor=None, config=None
+        )
         self.folder = UIDsFolder(self.svc, ())
 
 
@@ -174,8 +218,18 @@
         listing = list((yield self.folder.list()))
         self.assertEquals(
             [x.fields for x in listing],
-            [{"Record Type": "users", "Short Name": "wsanchez",
-              "Full Name": "Wilfredo Sanchez", "Name": wsanchez},
-              {"Record Type": "users", "Short Name": "dreid",
-              "Full Name": "David Reid", "Name": dreid}]
+            [
+                {
+                    "Record Type": "users",
+                    "Short Name": "wsanchez",
+                    "Full Name": "Wilfredo Sanchez",
+                    "Name": wsanchez
+                },
+                {
+                    "Record Type": "users",
+                    "Short Name": "dreid",
+                    "Full Name": "David Reid",
+                    "Name": dreid
+                },
+            ]
         )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140318/f391491e/attachment-0001.html>


More information about the calendarserver-changes mailing list