direntry parser wasn't eating a trailing newline
[htsworkflow.git] / test / test_copier.py
index 2cb92f0bdec4fb66b0de79323e5d0f93dcbadc45..6caf6a8cc311c9a2bc4a5f1f03c1f283300594d6 100644 (file)
@@ -42,6 +42,24 @@ notify_users: user3@example.fake
         self.failUnlessEqual(len(c.notify_users), 1)
         self.failUnlessEqual(c.notify_users[0], 'user3@example.fake')
 
+    def test_dirlist_filter(self):
+       """
+       test our dir listing parser
+       """
+       # everyone should have a root dir, and since we're not
+       # currently writing files... it should all be good
+       r = copier.rsync('/', '/', '/')
+
+       listing = [
+         'drwxrwxr-x           0 2007/12/29 12:34:56 071229_USI-EAS229_001_FC1234\n',
+         '-rwxrw-r--      123268 2007/12/29 17:39:31 2038EAAXX.rtf\n',
+         '-rwxrw-r--           6 2007/12/29 15:10:29 New Text Document.txt\n',
+       ]
+
+       result = r.list_filter(listing)
+       self.failUnlessEqual(len(result), 1)
+       self.failUnlessEqual(result[0][-1], '4')
+
 def suite():
     return unittest.makeSuite(testCopier,'test')