From 41c5b207f8482182834d7ea05d677316538f358b Mon Sep 17 00:00:00 2001 From: Alban Crequy Date: Tue, 1 Nov 2011 17:25:31 +0000 Subject: update-parameters.py: fix the cache directory Use $XDG_CACHE_HOME instead of $MC_ACCOUNT_DIR to find the file mcp-test-diverted-account-plugin.conf because the test-only plugin mcp-account-diversion uses g_get_user_cache_dir(). This is a no-op because both variables have the same value, as defined in tests/twisted/Makefile.am: BASIC_TESTS_ENVIRONMENT = \ MC_ACCOUNT_DIR=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX) \ XDG_CACHE_HOME=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX) \ However, this was not semantically correct, and the two directories could be different in the future, with installed tests for example. --- tests/twisted/account-manager/update-parameters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/twisted/account-manager/update-parameters.py b/tests/twisted/account-manager/update-parameters.py index 16c94d85..337ea73b 100644 --- a/tests/twisted/account-manager/update-parameters.py +++ b/tests/twisted/account-manager/update-parameters.py @@ -248,7 +248,7 @@ def test(q, bus, mc): not_yet = ret.value[0] assertEquals([], not_yet) - accounts_dir = os.environ['MC_ACCOUNT_DIR'] + cache_dir = os.environ['XDG_CACHE_HOME'] # fd.o #28557: when the file has been updated, the account parameter # has its two backslashes doubled to 4 (because of the .desktop encoding), @@ -257,7 +257,7 @@ def test(q, bus, mc): updated = False while i < 500: - for line in open(accounts_dir + + for line in open(cache_dir + '/mcp-test-diverted-account-plugin.conf', 'r'): if line.startswith('param-account=') and '\\' in line: assertEquals(r'param-account=\\\\' + '\n', line) -- cgit v1.2.3