def test_get_update_frequency_display_calls_format_duration_and_returns_its_return_value( self, mock_format_duration, garden_factory): garden = garden_factory.build(update_frequency=timedelta(minutes=1)) formatter = GardenFormatter(garden) ret_val = formatter.get_update_frequency_display() mock_format_duration.assert_called_once_with( garden.update_frequency.total_seconds()) assert ret_val == mock_format_duration.return_value
def is_displaying_info_for_garden(self, garden): formatter = GardenFormatter(garden) return all([ self.get_garden_status() == formatter.get_is_connected_display(), self.get_last_connected_from() == str( formatter.last_connection_ip), self.get_last_connected_at() == formatter.get_last_connection_time_display(), self.get_update_frequency() == formatter.get_update_frequency_display(), self.get_connection_strength() == formatter.get_connection_strength_display(), self.get_water_level() == formatter.get_water_level_display(), self.get_api_key() == str(formatter.token) ])