test_dataset.json
4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
{
"version": "1.0.0",
"agent": "youtube-crawler",
"description": "YouTube 爬虫测试数据集 - 包含边缘情况和异常场景",
"generated_at": "2026-04-01T00:00:00Z",
"total_cases": 12,
"cases": [
{
"id": "TEST_001",
"type": "edge_case",
"category": "empty_result",
"description": "空结果处理 - 无效分类 ID",
"input": {
"regionCode": "US",
"videoCategoryId": "999"
},
"expected": {
"items_count": 0,
"handled_gracefully": true,
"no_exception": true
}
},
{
"id": "TEST_002",
"type": "edge_case",
"category": "special_characters",
"description": "特殊字符标题处理",
"input": {
"test_titles": [
"Title with \"quotes\"",
"Title with 'apostrophes'",
"Title with 🎵 emoji",
"Title with, comma",
"Title with\nnewline"
]
},
"expected": {
"csv_export_safe": true,
"no_truncation": true
}
},
{
"id": "TEST_003",
"type": "edge_case",
"category": "large_numbers",
"description": "超大 viewCount 数值处理",
"input": {
"view_counts": [
"9223372036854775807",
"9999999999999"
]
},
"expected": {
"parsed_correctly": true,
"no_overflow": true,
"type": "integer"
}
},
{
"id": "TEST_004",
"type": "edge_case",
"category": "missing_fields",
"description": "缺失可选字段处理",
"input": {
"video_data": {
"id": "abc123",
"snippet": { "title": "Test" },
"statistics": {}
}
},
"expected": {
"default_values": {
"viewCount": 0,
"likeCount": null,
"commentCount": null
},
"no_crash": true
}
},
{
"id": "TEST_005",
"type": "edge_case",
"category": "private_deleted",
"description": "私密/删除视频处理",
"input": {
"video_ids": ["deleted123", "private456"]
},
"expected": {
"skipped": true,
"continued_processing": true
}
},
{
"id": "TEST_006",
"type": "error_case",
"category": "quota_exceeded",
"description": "配额耗尽场景",
"input": {
"quota_remaining": 0,
"request": {
"regionCode": "US"
}
},
"expected": {
"fallback_to_ytdlp": true,
"data_returned": true,
"warning_logged": true
}
},
{
"id": "TEST_007",
"type": "error_case",
"category": "network_timeout",
"description": "网络超时处理",
"input": {
"timeout": 30,
"retry_attempts": 3
},
"expected": {
"retried": true,
"max_retries": 3,
"final_error_clear": true
}
},
{
"id": "TEST_008",
"type": "error_case",
"category": "malformed_response",
"description": "异常响应格式处理",
"input": {
"response": "not valid json",
"status": 200
},
"expected": {
"parse_error_handled": true,
"no_crash": true
}
},
{
"id": "TEST_009",
"type": "integration",
"category": "full_workflow",
"description": "完整工作流测试 - API 方案",
"input": {
"regions": ["US", "JP"],
"categories": ["10", "20"],
"output_format": "json"
},
"expected": {
"all_regions_success": true,
"all_categories_success": true,
"output_valid": true,
"min_total_items": 100
}
},
{
"id": "TEST_010",
"type": "integration",
"category": "fallback_workflow",
"description": "降级工作流测试 - API 失败转 yt-dlp",
"input": {
"force_api_failure": true,
"fallback_enabled": true
},
"expected": {
"api_failed": true,
"fallback_triggered": true,
"ytdlp_succeeded": true,
"data_returned": true
}
},
{
"id": "TEST_011",
"type": "integration",
"category": "multi_format_export",
"description": "多格式同时导出",
"input": {
"regionCode": "US",
"export_formats": ["json", "csv"]
},
"expected": {
"json_exported": true,
"csv_exported": true,
"data_consistent": true
}
},
{
"id": "TEST_012",
"type": "integration",
"category": "cache_efficiency",
"description": "缓存效率验证",
"input": {
"same_request_times": 5,
"cache_ttl": 900
},
"expected": {
"api_calls_made": 1,
"cache_hits": 4,
"quota_saved": 4
}
}
]
}