@@ -5,13 +5,26 @@
55# under the terms of the GNU General Public License version 3, as published
66# by the Free Software Foundation.
77
8−from testtools.matchers import Equals, NotEquals
98from autopilot.matchers import Eventually
9+from testtools.matchers import Equals, NotEquals
10+from functools import wraps
1011
1112import logging
1213
1314logger = logging.getLogger(__name__)
1415
16+
17+def with_lightdm_mock(fn, mock_type):
18+ """A simple decorator that sets up the LightDM mock for a single test."""
19+ @wraps(fn)
20+ def wrapper(*args, **kwargs):
21+ logger.info("Setting up LightDM mock type '%s'", mock_type)
22+ return fn(*args, **kwargs)
23+ return wrapper
24+
25+
26+# TODO: Mixing classes like these are ikky. Remove them, and replace with
27+# something better!
1528class TestShellHelpers(object):
1629 """Helpers for testing the Shell"""
1730