Exemplo n.º 1
0
 def setUp(self):
     super().setUp()
     self.app = get_app()
     self.conn = self.engine.connect()
Exemplo n.º 2
0
from api.app import get_app
from flask_restplus import Resource, abort
from api.controllers.weather_c import WeatherController
from api.namespaces import ns_weather

app = get_app()


@ns_weather.route("/<city>")
class Weather(Resource):
    @app.api.doc(responses={
        200: 'Success',
        404: 'Not found'
    },
                 description='Get weather information by city')
    def get(self, city):
        """
        GET call for information by city
        :param city: city name
        :return: a dictionary with all information
        """
        info = WeatherController(city).get_info()
        if not info:
            abort(404, 'No information was found for this destination.')
        return info, 200
Exemplo n.º 3
0
 def setUp(self):
     super().setUp()
     self.app = get_app()
Exemplo n.º 4
0
 def setUp(self):
     self.app = get_app().test_client()
Exemplo n.º 5
0
from os import getcwd

from whitenoise import WhiteNoise

from api.app import get_app


application = WhiteNoise(get_app(), root='{}/static'.format(getcwd()))