Пример #1
0
 def test_502_listdir_two_levels(self):
     storage = DummyStorage(self.workspace)
     storage.checkout('3')
     result = storage.listdir('dir1/nested')
     answer = [
     {
         'author': 'pmr2.teststorage <*****@*****.**>',
         'permissions': '-rw-r--r--',
         'desc': '',
         'node': '3',
         'date': '2005-03-18 23:12:19',
         'size': '27',
         'basename': 'file',
         'file': 'dir1/nested/file',
         'baseview': 'file',
         'contenttype': None,
         'fullpath': None,
         'external': None,
     }]
     self.assertEqual(answer, self.filter_pathinfo(result))
     # include multiple /
     result = storage.listdir('dir1///nested')
     self.assertEqual(answer, self.filter_pathinfo(result))
Пример #2
0
 def test_500_listdir_root(self):
     storage = DummyStorage(self.workspace)
     storage.checkout('3')
     result = storage.listdir('')
     answer = [
     {
         'author': '',
         'permissions': 'drwxr-xr-x',
         'desc': '',
         'node': '3',
         'date': '',
         'size': '',
         'basename': 'dir1',
         'file': 'dir1',
         'baseview': 'file',
         'contenttype': None,
         'fullpath': None,
         'external': None,
     },
     {
         'author': 'pmr2.teststorage <*****@*****.**>',
         'permissions': '-rw-r--r--',
         'desc': '',
         'node': '3',
         'date': '2005-03-18 23:12:19',
         'size': '31',
         'basename': 'file1',
         'file': 'file1',
         'baseview': 'file',
         'contenttype': None,
         'fullpath': None,
         'external': None,
     },
     {
         'author': 'pmr2.teststorage <*****@*****.**>',
         'permissions': '-rw-r--r--',
         'desc': '',
         'node': '3',
         'date': '2005-03-18 23:12:19',
         'size': '21',
         'basename': 'file3',
         'file': 'file3',
         'baseview': 'file',
         'contenttype': None,
         'fullpath': None,
         'external': None,
     },
     ]
     self.assertEqual(answer, self.filter_pathinfo(result))
Пример #3
0
 def test_501_listdir_one_level(self):
     storage = DummyStorage(self.workspace)
     storage.checkout('3')
     result = storage.listdir('dir1')
     answer = [
     {
         'author': '',
         'permissions': 'drwxr-xr-x',
         'desc': '',
         'node': '3',
         'date': '',
         'size': '',
         'basename': 'dir2',
         'file': 'dir1/dir2',
         'baseview': 'file',
         'contenttype': None,
         'fullpath': None,
         'external': None,
     },
     {
         'author': '',
         'permissions': 'drwxr-xr-x',
         'desc': '',
         'node': '3',
         'date': '',
         'size': '',
         'basename': 'nested',
         'file': 'dir1/nested',
         'baseview': 'file',
         'contenttype': None,
         'fullpath': None,
         'external': None,
     },
     {
         'author': 'pmr2.teststorage <*****@*****.**>',
         'permissions': '-rw-r--r--',
         'desc': '',
         'node': '3',
         'date': '2005-03-18 23:12:19',
         'size': '19',
         'basename': 'f1',
         'file': 'dir1/f1',
         'baseview': 'file',
         'contenttype': None,
         'fullpath': None,
         'external': None,
     },
     {
         'author': 'pmr2.teststorage <*****@*****.**>',
         'permissions': '-rw-r--r--',
         'desc': '',
         'node': '3',
         'date': '2005-03-18 23:12:19',
         'size': '20',
         'basename': 'f2',
         'file': 'dir1/f2',
         'baseview': 'file',
         'contenttype': None,
         'fullpath': None,
         'external': None,
     },
     ]
     self.assertEqual(answer, self.filter_pathinfo(result))
     # include trailing /
     result = storage.listdir('dir1/')
     self.assertEqual(answer, self.filter_pathinfo(result))