@@ -0,0 +1,53 @@
1+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3+# Unity Autopilot Test Suite
4+# Copyright (C) 2014 Canonical
6+# This program is free software: you can redistribute it and/or modify
7+# it under the terms of the GNU General Public License as published by
8+# the Free Software Foundation, either version 3 of the License, or
9+# (at your option) any later version.
11+# This program is distributed in the hope that it will be useful,
12+# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+# GNU General Public License for more details.
16+# You should have received a copy of the GNU General Public License
17+# along with this program. If not, see <http://www.gnu.org/licenses/>.
20+"""Set up and clean up fixtures for the Unity acceptance tests."""
30+class FakeScopes(fixtures.Fixture):
33+ super(FakeScopes, self).setUp()
35+ fixtures.EnvironmentVariable(
37+ newvalue=self._get_fake_scopes_library_path()))
39+ def _get_fake_scopes_library_path(self):
40+ if unity8.running_installed_tests():
41+ mock_path = 'qml/scopefakes/'
43+ mock_path = os.path.join(
44+ '../lib/', sysconfig.get_config_var('MULTIARCH'),
45+ 'unity8/qml/scopefakes/')
46+ lib_path = unity8.get_lib_path()
47+ ld_library_path = os.path.abspath(os.path.join(lib_path, mock_path))
49+ if not os.path.exists(ld_library_path):
51+ 'Expected library path does not exists: %s.' % (
53+ return ld_library_path