-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mock_uss] Modify sharing behavior in mock_uss on injection (#269)
* Modify sharing behavior in mock_uss on injection * Added additional_fields to InjectFlightRequest * Fix format * Added documentation for MockUssFlightBehavior * Fix format * Implement PR suggestions --------- Co-authored-by: Benjamin Pelletier <[email protected]>
- Loading branch information
1 parent
5a685db
commit 0b6beea
Showing
14 changed files
with
179 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
monitoring/monitorlib/clients/mock_uss/mock_uss_scd_injection_api.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from implicitdict import ImplicitDict | ||
from typing import List, Optional | ||
from uas_standards.interuss.automated_testing.scd.v1.api import InjectFlightRequest | ||
|
||
|
||
class MockUssFlightBehavior(ImplicitDict): | ||
""" | ||
Interface for modifying mock_uss flight sharing behavior with other USSes | ||
Specify the http method and the fields to modify for those requests | ||
Eg - | ||
{"modify_sharing_methods"=["GET", "POST"], | ||
"modify_fields"={ | ||
"operational_intent_reference": {"state": "Flying"}, | ||
"operational_intent_details": {"priority": -1}, | ||
} | ||
} | ||
""" | ||
|
||
modify_sharing_methods: List[str] | ||
""" list of intent sharing http methods GET and POST to be modified""" | ||
|
||
modify_fields: dict | ||
"""dict that specifies the values for the fields to be overriden in the operational_intent while sharing""" | ||
|
||
|
||
class MockUSSInjectFlightRequest(InjectFlightRequest): | ||
"""InjectFlightRequest sent to mock_uss, which looks for the optional additional fields below.""" | ||
|
||
behavior: Optional[MockUssFlightBehavior] |
Oops, something went wrong.