[Zope3-checkins] SVN: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/tests/ add more tests to the filesystem publisher and fix some white space and one function name

Michael Kerrin michael.kerrin at openapp.biz
Fri Oct 7 04:39:46 EDT 2005


Log message for revision 38842:
  add more tests to the filesystem publisher and fix some white space and one function name

Changed:
  U   Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/tests/fstests.py
  U   Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/tests/test_ftpserver.py

-=-
Modified: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/tests/fstests.py
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/tests/fstests.py	2005-10-07 04:34:09 UTC (rev 38841)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/tests/fstests.py	2005-10-07 08:39:45 UTC (rev 38842)
@@ -33,8 +33,29 @@
     def test_type(self):
         self.assertEqual(self.filesystem.type(self.dir_name), 'd')
         self.assertEqual(self.filesystem.type(self.file_name), 'f')
+        self.assertEqual(self.filesystem.type('/'), 'd')
 
+    def test_ls(self):
+        self.assertEqual(self.filesystem.ls(self.dir_name),
+                         [{'group_write': 4, 'group_read': 2, 'type': 'f',
+                           'name': 'file.txt',
+                           'size': len(self.file_contents)},
+                          {'group_write': 0, 'group_read': 2, 'type': 'f',
+                           'name': 'protected.txt', 'size': 9}])
 
+    def test_lsinfo(self):
+        self.assertEqual(self.filesystem.lsinfo(self.dir_name),
+                         {'group_write': 4, 'group_read': 2, 'type': 'd',
+                          'name': 'dir'})
+
+    def test_size(self):
+        self.assertEqual(self.filesystem.size(self.file_name),
+                         len(self.file_contents))
+
+    def test_mtime(self):
+        ## this is a weird mtime value.
+        self.assertEqual(self.filesystem.mtime(self.file_name), None)
+
     def test_names(self):
         lst = self.filesystem.names(self.dir_name)
         lst.sort()
@@ -51,7 +72,6 @@
         self.filesystem.readfile(self.file_name, s, 2)
         self.assertEqual(s.getvalue(), self.file_contents[2:])
 
-
     def testReadPartOfFile2(self):
         s = StringIO()
         self.filesystem.readfile(self.file_name, s, 1, 5)
@@ -64,7 +84,6 @@
         self.filesystem.remove(self.file_name)
         self.failIf(self.filesystem.type(self.file_name))
 
-
     def testMkdir(self):
         path = self.dir_name + '/x'
         self.filesystem.mkdir(path)
@@ -75,13 +94,11 @@
         self.filesystem.rmdir(self.dir_name)
         self.failIf(self.filesystem.type(self.dir_name))
 
-
     def testRename(self):
         self.filesystem.rename(self.file_name, self.file_name + '.bak')
         self.assertEqual(self.filesystem.type(self.file_name), None)
         self.assertEqual(self.filesystem.type(self.file_name + '.bak'), 'f')
 
-
     def testWriteFile(self):
         s = StringIO()
         self.filesystem.readfile(self.file_name, s)
@@ -95,7 +112,6 @@
         self.filesystem.readfile(self.file_name, s)
         self.assertEqual(s.getvalue(), data)
 
-
     def testAppendToFile(self):
         data = ' again'
         s = StringIO(data)
@@ -139,7 +155,6 @@
         self.filesystem.readfile(self.file_name, s)
         self.assertEqual(s.getvalue(), expect)
 
-
     def testWriteNewFile(self):
         s = StringIO(self.file_contents)
         self.filesystem.writefile(self.file_name + '.new', s)
@@ -148,7 +163,6 @@
         self.filesystem.readfile(self.file_name, s)
         self.assertEqual(s.getvalue(), self.file_contents)
 
-
     def test_writable(self):
         self.failIf(self.filesystem.writable(self.dir_name))
         self.failIf(self.filesystem.writable(self.unwritable_filename))

Modified: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/tests/test_ftpserver.py
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/tests/test_ftpserver.py	2005-10-07 04:34:09 UTC (rev 38841)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/tests/test_ftpserver.py	2005-10-07 08:39:45 UTC (rev 38842)
@@ -79,7 +79,7 @@
         responseLines = wait(self.client.queueStringCommand('PASS root'))
         self.assertEqual(['230 User logged in, proceed'], responseLines)
 
-    def test_MLD(self):
+    def test_MKD(self):
         self._authLogin()
         responseLines = wait(self.client.queueStringCommand('MKD /newdir'))
         self.assertEqual(['257 "/newdir" created'], responseLines)



More information about the Zope3-Checkins mailing list