def test_request_drone(self):
     """Test the /Drone endpoint."""
     request_get = requests.get(DRONE_URL + 'api/Drone')
     request_put = requests.put(DRONE_URL + 'api/Drone',
                                data=json.dumps(get_drone_default()))
     request_post = requests.post(DRONE_URL + 'api/Drone',
                                  data=json.dumps(get_drone_default()))
     request_delete = requests.delete(DRONE_URL + 'api/Drone')
     # 404 if drone is not initialized use mechanics.drone_init to initialize
     assert request_get.status_code in [200, 404]
     assert request_put.status_code in [200, 201]
     assert request_post.status_code in [200, 201]
     assert request_delete.status_code == 405
 def test_request_drone(self):
     """Test the /Drone endpoint."""
     request_get = requests.get(DRONE_URL + 'api/Drone')
     request_put = requests.put(
         DRONE_URL + 'api/Drone', data=json.dumps(get_drone_default()))
     request_post = requests.post(
         DRONE_URL + 'api/Drone', data=json.dumps(get_drone_default()))
     request_delete = requests.delete(DRONE_URL + 'api/Drone')
     # 404 if drone is not initialized use mechanics.drone_init to initialize
     assert request_get.status_code in [200, 404]
     assert request_put.status_code in [200, 201]
     assert request_post.status_code in [200, 201]
     assert request_delete.status_code == 405
def init_drone_locally():
    """Initialize the drone locally with Negative identifier."""
    drone = get_drone_default()
    location = get_controller_location()["Location"]

    drone["State"]["Position"] = location
    add_drone_locally(drone)
    print("Drone initalized locally!")
def init_drone_locally():
    """Initialize the drone locally with Negative identifier."""
    drone = get_drone_default()
    location = get_controller_location()["Location"]

    drone["State"]["Position"] = location
    add_drone_locally(drone)
    print("Drone initalized locally!")
    def test_drone_data(self):
        """Test if drone data submitted is same as drone received back."""
        drone = get_drone_default()
        request_put = requests.put(
            DRONE_URL + 'api/Drone', data=json.dumps(drone))

        request_get = requests.get(DRONE_URL + 'api/Drone')
        received_drone = request_get.json()
        received_drone.pop("@id", None)
        received_drone.pop("@context", None)
        assert ordered(drone) == ordered(received_drone)
    def test_drone_data(self):
        """Test if drone data submitted is same as drone received back."""
        drone = get_drone_default()
        request_put = requests.put(DRONE_URL + 'api/Drone',
                                   data=json.dumps(drone))

        request_get = requests.get(DRONE_URL + 'api/Drone')
        received_drone = request_get.json()
        received_drone.pop("@id", None)
        received_drone.pop("@context", None)
        assert ordered(drone) == ordered(received_drone)
def init_drone_locally():
    """Initialize the drone locally with Negative identifier."""
    drone = get_drone_default()
    update_drone(drone)