-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create a titiler-sentinel instance in fixtures to be used in tests #80
base: main
Are you sure you want to change the base?
Conversation
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") # use token authentication | ||
|
||
|
||
def api_key_auth(api_key: str = Depends(oauth2_scheme)): | ||
"""api key auth dependency""" | ||
api_keys = [os.getenv("API_KEY")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this in the function to help with tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could maybe revert and patch the variable in tests
@@ -42,6 +41,8 @@ | |||
from titiler.core.errors import DEFAULT_STATUS_CODES, add_exception_handlers | |||
from titiler.core.factory import MultiBandTilerFactory | |||
|
|||
from cerulean_cloud.auth import api_key_auth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use absolute path
S1_METADATA = f.read() | ||
|
||
|
||
class Server(uvicorn.Server): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async def titiler_application(): | ||
"""Run app in Thread.""" | ||
with patch("rio_tiler.io.cogeo.rasterio") as rio: | ||
with patch("rio_tiler_pds.sentinel.aws.sentinel1.get_object") as s1meta: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we patch both rio-tiler and rio-tiler-pds to make sure we don't reach AWS resources
] | ||
] | ||
] | ||
"id" : "S1A_IW_GRDH_1SDV_20201121T225759_20201121T225828_035353_04216C_62EA", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh No I didn't see one already existed 🤦
The test is currently failing because a string is tryping to be combined with an asyncio object
working on a fix |
This PR replace the hardcoded URL by a internal fixture which will run
titiler_sentinel
in background.The Tiler is
patched
and should not fetch any external filescc @rbavery