def do_directions(self, data): """Get directions about a destination you are interested to.""" try: directions_to.main(data) except ValueError: print("Please enter destination") except ConnectionError: print(CONNECTION_ERROR_MSG)
def directions(self, data): """ Get directions about a destination you are interested to. -- Example: directions to the Eiffel Tower """ self = self._jarvis try: directions_to.main(data) except ValueError: print("Please enter destination")
def test_directions_with_only_destination_city(self, mock_directions): from_city = 0 to_city = 'Paris' data = "to {}".format(to_city) directions_to.main(data) mock_directions.assert_called_once_with(to_city, from_city)
def test_directions_with_destination_and_start_city(self, mock_directions): from_city = 'Madrid' to_city = 'Valencia' data = "to {} from {}".format(to_city, from_city) directions_to.main(data) mock_directions.assert_called_once_with(to_city, from_city)
def test_directions_with_start_and_destination_city(self, mock_directions): from_city = 'London' to_city = 'Manchester' data = "from {} to {}".format(from_city, to_city) directions_to.main(data) mock_directions.assert_called_once_with(to_city, from_city)
def do_directions(self, data): """Get directions about a destination you are interested to.""" directions_to.main(data)