Skip to content

Commit 0436676

Browse files
author
PachKosti
committed
#61 test fix
1 parent 3c55f46 commit 0436676

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mergin/test/test_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
TEST_DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_data')
1313

1414

15+
def toggle_geodiff(enabled):
16+
os.environ['GEODIFF_ENABLED'] = str(enabled)
17+
18+
1519
@pytest.fixture(scope='function')
1620
def mc():
1721
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):
211215

212216
@pytest.mark.parametrize("diffs_limit, push_geodiff_enabled, pull_geodiff_enabled", diff_test_scenarios)
213217
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)
216218

217219
test_project = f'test_sync_diff_{diffs_limit}_{int(push_geodiff_enabled)}_{int(pull_geodiff_enabled)}'
218220
project = API_USER + '/' + test_project
@@ -307,15 +309,14 @@ def toggle_geodiff(enabled):
307309

308310
def test_list_of_push_changes(mc):
309311
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)
312312

313313
test_project = 'test_list_of_push_changes'
314314
project = API_USER + '/' + test_project
315315
project_dir = os.path.join(TMP_DIR, test_project) # primary project dir for updates
316316

317317
cleanup(mc, project, [project_dir])
318318
shutil.copytree(TEST_DATA_DIR, project_dir)
319+
toggle_geodiff(True)
319320
mc.create_project(test_project, project_dir)
320321

321322
f_updated = 'base.gpkg'

0 commit comments

Comments
 (0)