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
@@ -49,15 +49,14 @@ def test_workflow_key_attr(func):
4949 [
5050 ("timezone" , configuration .WORKFLOW_TIME_ZONE ),
5151 ("project" , Project (configuration .WORKFLOW_PROJECT )),
52- ("tenant" , Tenant (configuration .WORKFLOW_TENANT )),
5352 (
5453 "user" ,
5554 User (
5655 configuration .USER_NAME ,
5756 configuration .USER_PASSWORD ,
5857 configuration .USER_EMAIL ,
5958 configuration .USER_PHONE ,
60- configuration .WORKFLOW_TENANT ,
59+ configuration .USER_TENANT ,
6160 configuration .WORKFLOW_QUEUE ,
6261 configuration .USER_STATE ,
6362 ),
@@ -146,7 +145,6 @@ def test_set_release_state_error(value):
146145 "set_attr,set_val,get_attr,get_val" ,
147146 [
148147 ("_project" , "project" , "project" , Project ("project" )),
149- ("_tenant" , "tenant" , "tenant" , Tenant ("tenant" )),
150148 ("_start_time" , "2021-01-01" , "start_time" , datetime (2021 , 1 , 1 )),
151149 ("_end_time" , "2021-01-01" , "end_time" , datetime (2021 , 1 , 1 )),
152150 ],
@@ -333,7 +331,6 @@ def test_workflow_get_define_without_task():
333331 "name" : TEST_WORKFLOW_NAME ,
334332 "description" : None ,
335333 "project" : configuration .WORKFLOW_PROJECT ,
336- "tenant" : configuration .WORKFLOW_TENANT ,
337334 "workerGroup" : configuration .WORKFLOW_WORKER_GROUP ,
338335 "warningType" : configuration .WORKFLOW_WARNING_TYPE ,
339336 "warningGroupId" : 0 ,
@@ -456,31 +453,6 @@ def test_workflow_simple_separate():
456453 assert all (["task-" in task .name for task in pd .task_list ])
457454
458455
459- @pytest .mark .parametrize (
460- "user_attrs" ,
461- [
462- {"tenant" : "tenant_specific" },
463- ],
464- )
465- def test_set_workflow_user_attr (user_attrs ):
466- """Test user with correct attributes if we specific assigned to workflow object."""
467- default_value = {
468- "tenant" : configuration .WORKFLOW_TENANT ,
469- }
470- with Workflow (TEST_WORKFLOW_NAME , ** user_attrs ) as pd :
471- user = pd .user
472- for attr in default_value :
473- # Get assigned attribute if we specific, else get default value
474- except_attr = (
475- user_attrs [attr ] if attr in user_attrs else default_value [attr ]
476- )
477- # Get actually attribute of user object
478- actual_attr = getattr (user , attr )
479- assert (
480- except_attr == actual_attr
481- ), f"Except attribute is { except_attr } but get { actual_attr } "
482-
483-
484456def test_schedule_json_none_schedule ():
485457 """Test function schedule_json with None as schedule."""
486458 with Workflow (
0 commit comments