上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 43 下一页
摘要: 创建两个test_XX.py文件分别测试桌面和服务器 test_desktop.py import pytest @pytest.mark.Desktop_Professional @pytest.mark.特性1 def test_1(): print('执行了桌面专业版特性1用例') asser 阅读全文
posted @ 2022-01-30 10:39 Tarzen 阅读(1212) 评论(0) 推荐(0)
摘要: import pytest @pytest.mark.Desktop_Professional @pytest.mark.特性1 def test_1(): print('执行了桌面专业版特性1用例') assert True @pytest.mark.Desktop_Professional @p 阅读全文
posted @ 2022-01-30 10:32 Tarzen 阅读(719) 评论(0) 推荐(0)
摘要: 安装虚拟化核心组件 安装方法 前提条件 已经配置yum源。配置方式请参见 安装操作需要root用户权限。 安装步骤 安装QEMU组件。 # yum install -y qemu 安装libvirt组件。 # yum install -y libvirt 启动libvirtd服务。 # system 阅读全文
posted @ 2022-01-28 10:10 Tarzen 阅读(3231) 评论(0) 推荐(0)
摘要: 可以声明多个请求体参数,例如 item 和 user: from typing import Optional from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseMode 阅读全文
posted @ 2022-01-26 17:08 Tarzen 阅读(83) 评论(0) 推荐(0)
摘要: 与使用 Query 为查询参数声明更多的校验和元数据的方式相同,你也可以使用 Path 为路径参数声明相同类型的校验和元数据。 from typing import Optional from fastapi import FastAPI, Path, Query app = FastAPI() @ 阅读全文
posted @ 2022-01-26 16:42 Tarzen 阅读(47) 评论(0) 推荐(0)
摘要: 额外的校验¶ 我们打算添加约束条件:即使 q 是可选的,但只要提供了该参数,则该参数值不能超过50个字符的长度。 导入 Query¶ 为此,首先从 fastapi 导入 Query: from typing import Optional from fastapi import FastAPI, Q 阅读全文
posted @ 2022-01-26 16:22 Tarzen 阅读(97) 评论(0) 推荐(0)
摘要: 当你需要将数据从客户端(例如浏览器)发送给 API 时,你将其作为「请求体」发送。 请求体是客户端发送给 API 的数据。响应体是 API 发送给客户端的数据。 你不能使用 GET 操作(HTTP 方法)发送请求体。 要发送数据,你必须使用下列方法之一:POST(较常见)、PUT、DELETE 或  阅读全文
posted @ 2022-01-26 16:00 Tarzen 阅读(82) 评论(0) 推荐(0)
摘要: 不属于路径参数时,它们将被自动解释为"查询字符串"参数 from fastapi import FastAPI app = FastAPI() fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Ba 阅读全文
posted @ 2022-01-26 15:50 Tarzen 阅读(49) 评论(0) 推荐(0)
摘要: 关于 async 我们先阅读一下廖老师的异步IO https://www.liaoxuefeng.com/wiki/1016959663602400/1017968846697824 路径参数 from fastapi import FastAPI app = FastAPI() @app.get( 阅读全文
posted @ 2022-01-26 15:29 Tarzen 阅读(64) 评论(0) 推荐(0)
摘要: pydantic enforces type hints at runtime, and provides user friendly errors when data is invalid. Define how data should be in pure, canonical python; 阅读全文
posted @ 2022-01-26 11:42 Tarzen 阅读(339) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 43 下一页