4
4
5
5
6
6
@pytest .fixture
7
- def mock_spec_file ():
8
- """Mock OpenAPI spec file for testing."""
9
- mock_spec = {
7
+ def sample_openapi_spec ():
8
+ """Sample OpenAPI spec for testing across multiple test files ."""
9
+ return {
10
10
"openapi" : "3.0.0" ,
11
11
"info" : {"title" : "Airflow API" , "version" : "1.0.0" },
12
12
"paths" : {
13
13
"/api/v1/dags" : {
14
14
"get" : {
15
15
"operationId" : "get_dags" ,
16
+ "summary" : "Get all DAGs" ,
17
+ "tags" : ["DAGs" ],
16
18
"responses" : {
17
19
"200" : {
18
20
"description" : "List of DAGs" ,
@@ -21,38 +23,9 @@ def mock_spec_file():
21
23
},
22
24
}
23
25
},
24
- }
25
- },
26
- "/api/v1/dags/{dag_id}" : {
27
- "get" : {
28
- "operationId" : "get_dag" ,
29
- "parameters" : [{"name" : "dag_id" , "in" : "path" , "required" : True , "schema" : {"type" : "string" }}],
30
- "responses" : {"200" : {"description" : "Successful response" , "content" : {"application/json" : {"schema" : {"type" : "object" , "properties" : {"dag_id" : {"type" : "string" }}}}}}},
31
- },
32
- "post" : {
33
- "operationId" : "post_dag_run" ,
34
- "parameters" : [{"name" : "dag_id" , "in" : "path" , "required" : True , "schema" : {"type" : "string" }}],
35
- "requestBody" : {
36
- "content" : {
37
- "application/json" : {
38
- "schema" : {
39
- "type" : "object" ,
40
- "properties" : {
41
- "conf" : {"type" : "object" },
42
- "dag_run_id" : {"type" : "string" },
43
- },
44
- }
45
- }
46
- }
47
- },
48
- "responses" : {
49
- "200" : {
50
- "description" : "Successful response" ,
51
- "content" : {"application/json" : {"schema" : {"type" : "object" , "properties" : {"dag_run_id" : {"type" : "string" }, "state" : {"type" : "string" }}}}},
52
- }
53
- },
54
26
},
27
+ "post" : {"operationId" : "create_dag" , "summary" : "Create a DAG" , "tags" : ["DAGs" ], "responses" : {"201" : {"description" : "Created" }}},
55
28
},
29
+ "/api/v1/connections" : {"get" : {"operationId" : "get_connections" , "summary" : "Get connections" , "tags" : ["Connections" ], "responses" : {"200" : {"description" : "Success" }}}},
56
30
},
57
31
}
58
- return mock_spec
0 commit comments