1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
# Copyright 2012 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
"""goodhope autopilot tests."""
13
from autopilot.introspection.qt import QtIntrospectionTestMixin
14
from autopilot.testcase import AutopilotTestCase
16
from goodhope.emulators.main_window import MainWindow
18
class GoodhopeTestCase(AutopilotTestCase, QtIntrospectionTestMixin):
20
"""A common test case class that provides several useful methods for goodhope tests."""
23
super(GoodhopeTestCase, self).setUp()
24
# Lets assume we are installed system wide if this file is somewhere in /usr
25
if os.path.realpath(__file__).startswith("/usr/"):
26
self.launch_test_installed()
28
self.launch_test_local()
30
def launch_test_local(self):
31
self.app = self.launch_test_application(
35
def launch_test_installed(self):
36
self.app = self.launch_test_application(
41
def main_window(self):
42
return MainWindow(self.app)