|
12 | 12 | TEST_DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_data')
|
13 | 13 |
|
14 | 14 |
|
| 15 | +def toggle_geodiff(enabled): |
| 16 | + os.environ['GEODIFF_ENABLED'] = str(enabled) |
| 17 | + |
| 18 | + |
15 | 19 | @pytest.fixture(scope='function')
|
16 | 20 | def mc():
|
17 | 21 | assert SERVER_URL and SERVER_URL.rstrip('/') != 'https://public.cloudmergin.com' and API_USER and USER_PWD
|
@@ -211,8 +215,6 @@ def test_ignore_files(mc):
|
211 | 215 |
|
212 | 216 | @pytest.mark.parametrize("diffs_limit, push_geodiff_enabled, pull_geodiff_enabled", diff_test_scenarios)
|
213 | 217 | def test_sync_diff(mc, diffs_limit, push_geodiff_enabled, pull_geodiff_enabled):
|
214 |
| - def toggle_geodiff(enabled): |
215 |
| - os.environ['GEODIFF_ENABLED'] = str(enabled) |
216 | 218 |
|
217 | 219 | test_project = f'test_sync_diff_{diffs_limit}_{int(push_geodiff_enabled)}_{int(pull_geodiff_enabled)}'
|
218 | 220 | project = API_USER + '/' + test_project
|
@@ -307,15 +309,14 @@ def toggle_geodiff(enabled):
|
307 | 309 |
|
308 | 310 | def test_list_of_push_changes(mc):
|
309 | 311 | PUSH_CHANGES_SUMMARY = "{'base.gpkg': {'geodiff_summary': [{'table': 'gpkg_contents', 'insert': 0, 'update': 1, 'delete': 0}, {'table': 'simple', 'insert': 1, 'update': 0, 'delete': 0}]}}"
|
310 |
| - def toggle_geodiff(enabled): |
311 |
| - os.environ['GEODIFF_ENABLED'] = str(enabled) |
312 | 312 |
|
313 | 313 | test_project = 'test_list_of_push_changes'
|
314 | 314 | project = API_USER + '/' + test_project
|
315 | 315 | project_dir = os.path.join(TMP_DIR, test_project) # primary project dir for updates
|
316 | 316 |
|
317 | 317 | cleanup(mc, project, [project_dir])
|
318 | 318 | shutil.copytree(TEST_DATA_DIR, project_dir)
|
| 319 | + toggle_geodiff(True) |
319 | 320 | mc.create_project(test_project, project_dir)
|
320 | 321 |
|
321 | 322 | f_updated = 'base.gpkg'
|
|
0 commit comments