Browse Source

fix tests with webdav

Guénaël Muller 5 years ago
parent
commit
d0eaeeba5c

+ 10 - 0
backend/tests_configs.ini View File

@@ -145,3 +145,13 @@ email.notification.smtp.user = test_user
145 145
 email.notification.smtp.password = just_a_password
146 146
 website.base_url = http://localhost:6543
147 147
 color.config_file_path = %(here)s/color-test.json
148
+
149
+[webdav_test]
150
+website.base_url = http://localhost:6543
151
+sqlalchemy.url = sqlite:///:memory:
152
+user.auth_token.validity = 604800
153
+depot_storage_dir = /tmp/test/depot
154
+depot_storage_name = test
155
+preview_cache_dir = /tmp/test/preview_cache
156
+color.config_file_path = %(here)s/color-test.json
157
+wsgidav.config_path = %(here)s/wsgidav-test.conf

+ 3 - 10
backend/tracim_backend/tests/library/test_webdav.py View File

@@ -22,22 +22,15 @@ from unittest.mock import MagicMock
22 22
 
23 23
 class TestWebdavFactory(StandardTest):
24 24
 
25
+    config_section = 'webdav_test'
26
+
25 27
     def test_unit__initConfig__ok__nominal_case(self):
26 28
         """
27 29
         Check if config is correctly modify for wsgidav using mocked
28 30
         wsgidav and tracim conf (as dict)
29 31
         :return:
30 32
         """
31
-        tracim_settings = {
32
-            'website.base_url': 'http://localhost:6543',
33
-            'sqlalchemy.url': 'sqlite:///:memory:',
34
-            'user.auth_token.validity': '604800',
35
-            'depot_storage_dir': '/tmp/test/depot',
36
-            'depot_storage_name': 'test',
37
-            'preview_cache_dir': '/tmp/test/preview_cache',
38
-            'wsgidav.config_path': 'development.ini'
39
-
40
-        }
33
+        tracim_settings = self.settings
41 34
         wsgidav_setting = DEFAULT_CONFIG.copy()
42 35
         wsgidav_setting.update(
43 36
             {

+ 10 - 0
backend/wsgidav-test.conf View File

@@ -0,0 +1,10 @@
1
+host  = "0.0.0.0"
2
+port = 3030
3
+show_history = True
4
+show_deleted = True
5
+show_archived = True
6
+manager_locks = True
7
+root_path = ''
8
+acceptbasic = True
9
+acceptdigest = False
10
+defaultdigest = False