~fginther/ubuntu-weather-app/cmake-plus-weather-channel

« back to all changes in this revision

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

  • Committer: Martin Borho
  • Date: 2014-01-23 21:11:25 UTC
  • Revision ID: martin@borho.net-20140123211125-0n6uyn8yz01souux
updated tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
from __future__ import absolute_import
11
11
 
 
12
from unittest import skip
12
13
from testtools.matchers import Equals, Is, Not
13
14
from autopilot.matchers import Eventually
14
15
import logging
57
58
            'QQuickText', objectName='CurrentTempText')
58
59
        if units == "imperial":
59
60
            self.assertThat(today_temp_scale.text, Eventually(Equals(u'°F')))
60
 
            self.assertThat(today_temp.text, Eventually(Equals(u'43')))
61
 
            self.assertThat(tomorrow_temp.text, Eventually(Equals(u'45')))
 
61
            self.assertThat(today_temp.text, Eventually(Equals(u'26')))
 
62
            self.assertThat(tomorrow_temp.text, Eventually(Equals(u'23')))
62
63
        else:
63
64
            self.assertThat(today_temp_scale.text, Eventually(Equals(u'°C')))
64
 
            self.assertThat(today_temp.text, Eventually(Equals(u'6')))
65
 
            self.assertThat(tomorrow_temp.text, Eventually(Equals(u'7')))
 
65
            self.assertThat(today_temp.text, Eventually(Equals(u'-3')))
 
66
            self.assertThat(tomorrow_temp.text, Eventually(Equals(u'-5')))
66
67
 
67
68
    def _check_wind_units(self, wind_units):
68
69
        """Checks selected units by values from the first location tab"""
81
82
            Eventually(Not(Is(None))))
82
83
        wind_value = wind_component.select_single('QQuickText', objectName='WeatherDetailValue')
83
84
        if wind_units == "mph":
84
 
            self.assertThat(wind_unit.text, Eventually(Equals(u'mph WSW')))
85
 
            self.assertThat(wind_value.text, Eventually(Equals(u'15')))
 
85
            self.assertThat(wind_unit.text, Eventually(Equals(u'mph ESE')))
 
86
            self.assertThat(wind_value.text, Eventually(Equals(u'49')))
86
87
        else:
87
 
            self.assertThat(wind_unit.text, Eventually(Equals(u'km/h WSW')))
88
 
            self.assertThat(wind_value.text, Eventually(Equals(u'24')))
 
88
            self.assertThat(wind_unit.text, Eventually(Equals(u'km/h ESE')))
 
89
            self.assertThat(wind_value.text, Eventually(Equals(u'22')))
89
90
 
90
91
    def _check_precipitation_units(self, pre_units):
91
92
        """Checks selected units by values from the first location tab"""
284
285
        self.assertThat(load_indicator.running, Eventually(Equals(False)))
285
286
        self._check_wind_units('kmh')
286
287
 
 
288
    @skip("data not available")
287
289
    def test_switch_precipitation_scale(self):
288
290
        """Tests switching the precipition scale in the settings"""
289
291
        # first check metric values and open the settings sheet