File: test_tailing_slash_client_it.py

package info (click to toggle)
python-webdavclient 3.14.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 644 kB
  • sloc: python: 2,241; xml: 535; makefile: 5; sh: 3
file content (29 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import unittest

from tests.test_client_it import ClientTestCase


class TailingSlashClientTestCase(ClientTestCase):
    options = {
        'webdav_hostname': 'http://localhost:8585/',
        'webdav_login': 'alice',
        'webdav_password': 'secret1234',
        'webdav_override_methods': {
            'check': 'GET'
        }
    }

    def test_timeout_set(self):
        self.assertEqual(30, self.client.timeout)

    def test_list_inner(self):
        self._prepare_for_downloading(True)
        file_list = self.client.list(self.remote_inner_path_dir)
        self.assertIsNotNone(file_list, 'List of files should not be None')

    def test_hostname_no_tailing_slash(self):
        self.assertEqual('5', self.client.webdav.hostname[-1])


if __name__ == '__main__':
    unittest.main()