@@ -104,7 +104,7 @@ async def test_validate_plugin_with_previous(
104104 需要能够正常更新 author_id, tags 和 is_official 等信息
105105 """
106106 from src .providers .docker_test import Metadata
107- from src .providers .models import RegistryPlugin , StoreTestResult
107+ from src .providers .models import Color , RegistryPlugin , StoreTestResult , Tag
108108 from src .providers .store_test .validation import StorePlugin , validate_plugin
109109
110110 mock_datetime = mocker .patch ("src.providers.models.datetime" )
@@ -119,7 +119,7 @@ async def test_validate_plugin_with_previous(
119119 module_name = "module_name" ,
120120 project_link = "project_link" ,
121121 author_id = 1 ,
122- tags = [],
122+ tags = [Tag ( label = "test" , color = Color ( "ffffff" )) ],
123123 is_official = True ,
124124 )
125125
@@ -167,23 +167,23 @@ async def test_validate_plugin_with_previous(
167167 )
168168 )
169169
170- assert new_plugin == snapshot (
171- RegistryPlugin (
172- author = "he0119 " ,
173- desc = "订阅牛客/CF/AT平台的比赛信息 " ,
174- homepage = "https://nonebot.dev/ " ,
175- is_official = True ,
176- module_name = "module_name " ,
177- name = "TREEHELP " ,
178- project_link = "project_link" ,
179- skip_test = False ,
180- supported_adapters = None ,
181- tags = [] ,
182- time = "2023-09-01T00:00:00+00:00Z" ,
183- type = "application " ,
184- valid = True ,
185- version = "0.2.0" ,
186- )
170+ assert new_plugin . model_dump () == snapshot (
171+ {
172+ "module_name" : "module_name " ,
173+ "project_link" : "project_link " ,
174+ "name" : "TREEHELP " ,
175+ "desc" : "订阅牛客/CF/AT平台的比赛信息" ,
176+ "author" : "he0119 " ,
177+ "homepage" : "https://nonebot.dev/ " ,
178+ "tags" : [{ "label" : "test" , "color" : "#ffffff" }] ,
179+ "is_official" : True ,
180+ "type" : "application" ,
181+ "supported_adapters" : None ,
182+ "valid" : True ,
183+ "time" : "2023-09-01T00:00:00+00:00Z " ,
184+ "version" : "0.2.0" ,
185+ "skip_test" : False ,
186+ }
187187 )
188188
189189 assert mocked_api ["homepage" ].called
0 commit comments