def test_get_andean_drone_in_field_public_mode_valid(self): y = [ { "name": "qH006", "mode": "Customer", "state": "OFF", "qhawax_type": "AEREAL", "main_inca": -1.0, "id": 179, "qhawax_id": 179, "eca_noise_id": 2, "comercial_name": "Wakanda Awakening", "lat": -12.3578897, "lon": -76.7912213, "area_name": "Residential Zone", }, { "name": "qH058", "mode": "Customer", "state": "OFF", "qhawax_type": "AEREAL", "main_inca": -1.0, "id": 184, "qhawax_id": 184, "eca_noise_id": 1, "comercial_name": "Aereo Prueba", "lat": -11.998472864017, "lon": -76.9984387510529, "area_name": "Special Protection Zone", }, ] self.assertAlmostEqual( get_business_helper.queryQhawaxTypeInFieldInPublicMode("AEREAL"), y )
def test_get_andean_drone_in_field_public_mode_valid(self): y = [{ 'name': 'qH006', 'mode': 'Customer', 'state': 'OFF', 'qhawax_type': 'AEREAL', 'main_inca': -1.0, 'id': 179, 'qhawax_id': 179, 'eca_noise_id': 2, 'comercial_name': 'Wakanda Awakening', 'lat': -12.3578897, 'lon': -76.7912213, 'area_name': 'Residential Zone' }, { 'name': 'qH058', 'mode': 'Customer', 'state': 'OFF', 'qhawax_type': 'AEREAL', 'main_inca': -1.0, 'id': 184, 'qhawax_id': 184, 'eca_noise_id': 1, 'comercial_name': 'Aereo Prueba', 'lat': -11.998472864017, 'lon': -76.9984387510529, 'area_name': 'Special Protection Zone' }] self.assertAlmostEqual( get_business_helper.queryQhawaxTypeInFieldInPublicMode("AEREAL"), y)
def getQhawaxInMap(): """Gets a list of qHAWAXs filter by company ID""" try: qhawax_in_field = get_business_helper.queryQhawaxTypeInFieldInPublicMode( 'STATIC_EXT') return make_response(jsonify(qhawax_in_field), 200) except TypeError as e: json_message = jsonify({"error": "'%s'" % (e)}) return make_response(json_message, 400)
def getDronesInMap(): """Gets a list of qHAWAXs filter by company ID""" try: drones_in_field = ( get_business_helper.queryQhawaxTypeInFieldInPublicMode("AEREAL")) if drones_in_field != []: return make_response(jsonify(drones_in_field), 200) return make_response(jsonify({"Warning": "Drones in field not found"}), 400) except TypeError as e: json_message = jsonify({"error": "'%s'" % (e)}) return make_response(json_message, 400)
def getDronesInMap(): """ Gets a list of qHAWAXs filter by company ID """ try: drones_in_field = get_business_helper.queryQhawaxTypeInFieldInPublicMode( 'AEREAL') if (drones_in_field != []): return make_response(jsonify(drones_in_field), 200) return make_response(jsonify({'Warning': 'Drones in field not found'}), 400) except TypeError as e: json_message = jsonify({'error': '\'%s\'' % (e)}) return make_response(json_message, 400)
def test_get_qhawax_in_field_public_mode_valid(self): y = [{ "area_name": "Comercial Zone", "comercial_name": "Universidad Nacional de San Antonio Abad del Cusco", "eca_noise_id": 3, "id": 327, "lat": -12.598634, "lon": -69.187518, "main_inca": -1.0, "mode": "Customer", "name": "qH021", "qhawax_id": 307, "qhawax_type": "STATIC", "state": "OFF" }] self.assertAlmostEqual( get_business_helper.queryQhawaxTypeInFieldInPublicMode("STATIC"), y)