~unity-team/ubuntu-system-settings/welcome-wizard

« back to all changes in this revision

Viewing changes to tests/autopilot/ubuntu_system_settings/tests/test_plugins.py

  • Committer: Michael Terry
  • Date: 2014-02-13 15:27:47 UTC
  • mfrom: (485.1.129 ubuntu-system-settings)
  • Revision ID: michael.terry@canonical.com-20140213152747-dwu4r5z4o5zesqvd
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
from testtools.matchers import Contains, Equals, NotEquals, GreaterThan, raises
13
13
 
14
14
from ubuntu_system_settings.tests import (UbuntuSystemSettingsTestCase,
 
15
     UbuntuSystemSettingsUpowerTestCase,
15
16
     UbuntuSystemSettingsBatteryTestCase)
16
17
from ubuntu_system_settings.utils.i18n import ugettext as _
17
18
 
85
86
        plugin = self.main_view.select_single(objectName='entryComponent-online-accounts')
86
87
        self.assertThat(plugin, NotEquals(None))
87
88
 
88
 
    def test_no_battery_plugin_without_battery(self):
89
 
        """ Checks whether the Battery plugin is not available as we have no battery """
90
 
        self.assertThat(lambda: self.main_view.select_single(objectName='entryComponent-battery'),
91
 
            raises(StateNotFoundError))
92
 
 
93
 
    def test_battery_plugin_battery_hotplugging(self):
94
 
        """ Checks whether hotplugging a battery makes the panel visible """
95
 
        self.add_mock_battery()
96
 
        plugin = self.main_view.select_single(objectName='entryComponent-battery')
97
 
        self.assertThat(plugin, NotEquals(None))
98
 
 
99
89
    def test_timedate_plugin(self):
100
90
        """ Checks whether the Time & Date plugin is available """
101
91
        plugin = self.main_view.select_single(objectName='entryComponent-time-date')
111
101
        plugin = self.main_view.select_single(objectName='entryComponent-system-update')
112
102
        self.assertThat(plugin, NotEquals(None))
113
103
 
114
 
class SystemSettingsUpowerTestCases(UbuntuSystemSettingsBatteryTestCase):
 
104
class SystemSettingsUpowerTestCases(UbuntuSystemSettingsUpowerTestCase):
115
105
    def setUp(self):
116
106
        super(SystemSettingsUpowerTestCases, self).setUp()
117
107
 
 
108
    def test_no_battery_plugin_without_battery(self):
 
109
        """ Checks whether the Battery plugin is not available as we have no battery """
 
110
        self.assertThat(lambda: self.main_view.select_single(objectName='entryComponent-battery'),
 
111
            raises(StateNotFoundError))
 
112
 
 
113
    def test_battery_plugin_battery_hotplugging(self):
 
114
        """ Checks whether hotplugging a battery makes the panel visible """
 
115
        self.add_mock_battery()
 
116
        plugin = self.main_view.select_single(objectName='entryComponent-battery')
 
117
        self.assertThat(plugin, NotEquals(None))
 
118
 
 
119
class SystemSettingsBatteryTestCases(UbuntuSystemSettingsBatteryTestCase):
 
120
    def setUp(self):
 
121
        super(SystemSettingsBatteryTestCases, self).setUp()
 
122
 
118
123
    def test_battery_plugin(self):
119
124
        """ checks whether the Battery plugin is available """
120
125
        plugin = self.main_view.select_single(objectName='entryComponent-battery')