test_usage.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:vws-python 作者: adamtheturtle 项目源码 文件源码
def assert_valid_credentials(access_key: str, secret_key: str) -> None:
    """
    Given credentials, assert that they can authenticate with a Vuforia
    database.

    Raises:
        AssertionError: The given credentials fail to authenticate with a
            Vuforia database.
    """
    credentials = VuforiaServerCredentials(
        database_name=uuid.uuid4().hex,
        access_key=access_key,
        secret_key=secret_key,
    )

    response = get_vws_target(
        vuforia_server_credentials=credentials,
        target_id=uuid.uuid4().hex,
    )

    # This shows that the response does not give an authentication
    # error which is what would happen if the keys were incorrect.
    assert response.status_code == codes.NOT_FOUND
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号