def test_get_is_connected_display_returns_correct_string( self, garden_factory, is_connected, expected): formatter = GardenFormatter( garden_factory.build(is_connected=is_connected)) ret_val = formatter.get_is_connected_display() assert ret_val == expected
def test_get_is_connected_element_return_value_contains_is_connected_display_and_badge_classes( self, garden_factory): formatter = GardenFormatter(garden_factory.build()) ret1 = 'ret1' ret2 = 'ret2' formatter.get_is_connected_display = Mock(return_value=ret1) formatter.get_is_connected_badge_class = Mock(return_value=ret2) ret_val = formatter.get_is_connected_element() assert formatter.get_is_connected_display.return_value in ret_val assert formatter.get_is_connected_badge_class.return_value in ret_val
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) ])