on xenial help sign in
Use XDG_DATA_DIRS instead.
commitb116735e168054b81a77879d56924e3b72c9a37c authorMichał Sawicz <michal.sawicz@canonical.com> dateWed 16 Oct 2013, 14:03 (13 years ago) parentd8a5acd
2 files changed+11−6
tests/autopilot/unity8/__init__.py+9−4 tests/autopilot/unity8/shell/tests/__init__.py+2−2
tests/autopilot/unity8/__init__.py+9−4
@@ -83,16 +83,21 @@ def get_binary_path(binary="unity8"):
8383 raise RuntimeError("Unable to locate %s binary: %r" % (binary, e))
8484 return binary_path
8585
86−def get_data_path():
87− """Return the path to XDG_DATA_HOME."""
86+def get_data_dirs():
87+ """Prepend a local path to XDG_DATA_DIRS."""
88+ xdg_path = os.getenv("XDG_DATA_DIRS")
8889 if running_installed_tests():
89− return ""
90+ return xdg_path or ""
9091 else:
91− return os.path.abspath(
92+ data_path = os.path.abspath(
9293 os.path.join(os.path.dirname(__file__),
9394 "../share"
9495 )
9596 )
97+ if xdg_path:
98+ return "{0}:{1}".format(data_path, xdg_path)
99+ else:
100+ return data_path
96101
97102def get_grid_size():
98103 grid_size = os.getenv('GRID_UNIT_PX')
tests/autopilot/unity8/shell/tests/__init__.py+2−2
@@ -41,7 +41,7 @@ from unity8 import (
4141 get_binary_path,
4242 get_mocks_library_path,
4343 get_default_extra_mock_libraries,
44− get_data_path
44+ get_data_dirs
4545)
4646from unity8.shell.emulators import UnityEmulatorBase
4747from unity8.shell.emulators.dash import Dash
@@ -122,7 +122,7 @@ class UnityTestCase(AutopilotTestCase):
122122 self._lightdm_mock_type = None
123123 self._qml_mock_enabled = True
124124 self._environment = {
125− 'XDG_DATA_HOME': get_data_path()
125+ 'XDG_DATA_DIRS': get_data_dirs()
126126 }
127127
128128 #### FIXME: This is a work around re: lp:1238417 ####