@@ -1,42 +0,0 @@
1−# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2−# Copyright 2013 Canonical
4−# This program is free software: you can redistribute it and/or modify it
5−# under the terms of the GNU General Public License version 3, as published
6−# by the Free Software Foundation.
8−from autopilot.matchers import Eventually
9−from testtools.matchers import Equals, NotEquals
10−from functools import wraps
13−from unity8 import get_lib_path
18−logger = logging.getLogger(__name__)
21−def with_lightdm_mock(mock_type):
22− """A simple decorator that sets up the LightDM mock for a single test."""
23− def with_lightdm_mock_internal(fn):
25− def wrapper(*args, **kwargs):
26− logger.info("Setting up LightDM mock type '%s'", mock_type)
27− lib_path = get_lib_path()
28− new_ld_library_path = os.path.join(
30− "qml/mocks/LightDM/",
33− if not os.path.exists(new_ld_library_path):
35− "LightDM mock '%s' does not exist." % mock_type
38− logger.info("New library path: %s", new_ld_library_path)
39− args[0].patch_environment('LD_LIBRARY_PATH', new_ld_library_path)
40− return fn(*args, **kwargs)
42− return with_lightdm_mock_internal