interuss / dss

InterUSS Platform's implementation of the ASTM DSS concept for RID and flight coordination.
Apache License 2.0
124 stars 90 forks source link

`/subscriptions` endpoint gives a `404` error #582

Closed svishnu-flyanra closed 3 years ago

svishnu-flyanra commented 3 years ago

In the test test_id_conversion_bug_v5 in the file test_operation_special_cases.py , when trying to call the subscription end point an error 404 is received. From the v0.3.17 /subscriptions/{sub_id} endpoint it seems like resp = scd_session.put('/subscriptions/{}'.format(sub_uuid), json=req) should give one of the prescribed error codes. But it does not.

=================================== FAILURES ===================================
__________________________ test_id_conversion_bug_v5 ___________________________

ids = <function ids.<locals>.<lambda> at 0x7f62130e1310>, scd_api = '0.3.17'
scd_session = <monitoring.monitorlib.infrastructure.DSSTestSession object at 0x7f6213190d90>

    @for_api_versions(scd.API_0_3_5, scd.API_0_3_17)
    @default_scope(SCOPE_SC)
    def test_id_conversion_bug_v5(ids, scd_api, scd_session):
      sub_uuid = ids(SUB_TYPE)
      time_ref = datetime.datetime.utcnow() + datetime.timedelta(days=1)
      time_start = datetime.datetime(time_ref.year, time_ref.month, time_ref.day, 1, 30)
      time_end = datetime.datetime(time_ref.year, time_ref.month, time_ref.day, 22, 15)
      req = {
        "extents": {
          "volume": {
            "outline_polygon": {
              "vertices": [
                { "lng": -91.49723052978516, "lat": 41.70085834502109 },
                { "lng": -91.50341033935547, "lat": 41.6770148220322 },
                { "lng": -91.47989273071289, "lat": 41.67509157220958 },
                { "lng": -91.4663314819336, "lat": 41.69329603398001 }
              ]
            },
            "altitude_upper": {"units": "M", "reference": "W84", "value": 764.79037},
            "altitude_lower": {"units": "M", "reference": "W84", "value": 23.24352}
          },
          "time_start": {"value": time_start.isoformat() + "Z", "format": "RFC3339"},
          "time_end": {"value": time_end.isoformat() + "Z", "format": "RFC3339"}
        },
        "old_version": 0,
        "uss_base_url": "http://localhost:12012/services/uss/public/uss/v1/",
        "notify_for_constraints": True
      }
      resp = scd_session.put('/subscriptions/{}'.format(sub_uuid), json=req)
>     assert resp.status_code == 200, resp.content
E     AssertionError: b'{
E         "error": "Subscription 000000d4-ffff-40ff-a64b-a8fb8db60000 not found",
E         "code": 5,
E         "message": "Subscription 000000d4-ffff-40ff-a64b-a8fb8db60000 not found",
E         "error_id": "E:f8e22b99-ffd5-4959-997a-4e358c317f80"
E       }'
E     assert 404 == 200
E      +  where 404 = <Response [404]>.status_code

scd/test_operation_special_cases.py:189: AssertionError
BenjaminPelletier commented 3 years ago

Resolved primarily by #588, but supported by other work as well