2828from pydolphinscheduler .core .resource import Resource
2929from pydolphinscheduler .core .workflow import Workflow
3030from pydolphinscheduler .exceptions import PyDSParamException
31- from pydolphinscheduler .models import Project , Tenant , User
31+ from pydolphinscheduler .models import Project , User
3232from pydolphinscheduler .tasks .switch import Branch , Default , Switch , SwitchCondition
3333from pydolphinscheduler .utils .date import conv_to_schedule
3434from tests .testing .task import Task
@@ -51,15 +51,14 @@ def test_workflow_key_attr(func):
5151 [
5252 ("timezone" , configuration .WORKFLOW_TIME_ZONE ),
5353 ("project" , Project (configuration .WORKFLOW_PROJECT )),
54- ("tenant" , Tenant (configuration .WORKFLOW_TENANT )),
5554 (
5655 "user" ,
5756 User (
5857 configuration .USER_NAME ,
5958 configuration .USER_PASSWORD ,
6059 configuration .USER_EMAIL ,
6160 configuration .USER_PHONE ,
62- configuration .WORKFLOW_TENANT ,
61+ configuration .USER_TENANT ,
6362 configuration .WORKFLOW_QUEUE ,
6463 configuration .USER_STATE ,
6564 ),
@@ -148,7 +147,6 @@ def test_set_release_state_error(value):
148147 "set_attr,set_val,get_attr,get_val" ,
149148 [
150149 ("_project" , "project" , "project" , Project ("project" )),
151- ("_tenant" , "tenant" , "tenant" , Tenant ("tenant" )),
152150 ("_start_time" , "2021-01-01" , "start_time" , datetime (2021 , 1 , 1 )),
153151 ("_end_time" , "2021-01-01" , "end_time" , datetime (2021 , 1 , 1 )),
154152 ],
@@ -335,7 +333,6 @@ def test_workflow_get_define_without_task():
335333 "name" : TEST_WORKFLOW_NAME ,
336334 "description" : None ,
337335 "project" : configuration .WORKFLOW_PROJECT ,
338- "tenant" : configuration .WORKFLOW_TENANT ,
339336 "workerGroup" : configuration .WORKFLOW_WORKER_GROUP ,
340337 "warningType" : configuration .WORKFLOW_WARNING_TYPE ,
341338 "warningGroupId" : 0 ,
@@ -458,31 +455,6 @@ def test_workflow_simple_separate():
458455 assert all (["task-" in task .name for task in workflow .task_list ])
459456
460457
461- @pytest .mark .parametrize (
462- "user_attrs" ,
463- [
464- {"tenant" : "tenant_specific" },
465- ],
466- )
467- def test_set_workflow_user_attr (user_attrs ):
468- """Test user with correct attributes if we specific assigned to workflow object."""
469- default_value = {
470- "tenant" : configuration .WORKFLOW_TENANT ,
471- }
472- with Workflow (TEST_WORKFLOW_NAME , ** user_attrs ) as workflow :
473- user = workflow .user
474- for attr in default_value :
475- # Get assigned attribute if we specific, else get default value
476- except_attr = (
477- user_attrs [attr ] if attr in user_attrs else default_value [attr ]
478- )
479- # Get actually attribute of user object
480- actual_attr = getattr (user , attr )
481- assert (
482- except_attr == actual_attr
483- ), f"Except attribute is { except_attr } but get { actual_attr } "
484-
485-
486458def test_schedule_json_none_schedule ():
487459 """Test function schedule_json with None as schedule."""
488460 with Workflow (
0 commit comments