浏览代码

fix tests with webdav

Guénaël Muller 6 年前
父节点
当前提交
d0eaeeba5c
共有 3 个文件被更改,包括 23 次插入10 次删除
  1. 10 0
      backend/tests_configs.ini
  2. 3 10
      backend/tracim_backend/tests/library/test_webdav.py
  3. 10 0
      backend/wsgidav-test.conf

+ 10 - 0
backend/tests_configs.ini 查看文件

145
 email.notification.smtp.password = just_a_password
145
 email.notification.smtp.password = just_a_password
146
 website.base_url = http://localhost:6543
146
 website.base_url = http://localhost:6543
147
 color.config_file_path = %(here)s/color-test.json
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 查看文件

22
 
22
 
23
 class TestWebdavFactory(StandardTest):
23
 class TestWebdavFactory(StandardTest):
24
 
24
 
25
+    config_section = 'webdav_test'
26
+
25
     def test_unit__initConfig__ok__nominal_case(self):
27
     def test_unit__initConfig__ok__nominal_case(self):
26
         """
28
         """
27
         Check if config is correctly modify for wsgidav using mocked
29
         Check if config is correctly modify for wsgidav using mocked
28
         wsgidav and tracim conf (as dict)
30
         wsgidav and tracim conf (as dict)
29
         :return:
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
         wsgidav_setting = DEFAULT_CONFIG.copy()
34
         wsgidav_setting = DEFAULT_CONFIG.copy()
42
         wsgidav_setting.update(
35
         wsgidav_setting.update(
43
             {
36
             {

+ 10 - 0
backend/wsgidav-test.conf 查看文件

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