~elopio/ubuntu-weather-app/fix1248648-options_object_names

« back to all changes in this revision

Viewing changes to tests/autopilot/ubuntu_weather_app/emulators.py

  • Committer: Tarmac
  • Author(s): Martin Borho
  • Date: 2013-10-07 07:52:06 UTC
  • mfrom: (131.2.7 adddel)
  • Revision ID: tarmac-20131007075206-8miwdxbr7e06dvg0
fixes Bug #1230297: Removing a location add adding a new one fails. Fixes: https://bugs.launchpad.net/bugs/1230297.

Approved by Ubuntu Phone Apps Jenkins Bot, Raúl Yeguas.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
class MainView(toolkit_emulators.MainView):
16
16
 
17
 
    def get_object(self, typeName, name):
18
 
        """Get a specific object"""
19
 
        return self.select_single(typeName, objectName=name)
20
 
 
21
 
    def get_objects(self, typeName, name):
22
 
        """Get more than one object"""
23
 
        return self.select_many(typeName, objectName=name)
24
 
 
25
17
    def get_tabs(self):
26
18
        """Return the LocationTabs emulator of the MainView."""
27
19
        tabs = self.select_single(Tabs)
31
23
class Tabs(toolkit_emulators.UbuntuUIToolkitEmulatorBase):
32
24
    """LocationTabs Autopilot emulator."""
33
25
 
34
 
    def get_current_tab(self): 
35
 
        """Return the currently selected tab.""" 
 
26
    def get_current_tab(self):
 
27
        """Return the currently selected tab."""
36
28
        return self.select_many('LocationTab')[self.selectedTabIndex]
37
29
 
38
 
    def get_number_of_tabs(self): 
39
 
        """Return the number of tabs.""" 
 
30
    def get_number_of_tabs(self):
 
31
        """Return the number of tabs."""
40
32
        return len(self.select_many('LocationTab'))