Skip to content

Commit a410e91

Browse files
committed
style
1 parent 6d8c4ed commit a410e91

8 files changed

Lines changed: 5 additions & 153 deletions

File tree

src/pydolphinscheduler/cli/tenants.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

src/pydolphinscheduler/cli/users.py

Whitespace-only changes.

src/pydolphinscheduler/default_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ java_gateway:
3939
default:
4040
# Default value for dolphinscheduler's user object
4141
user:
42-
name: userPythonGateway1
42+
name: userPythonGateway
4343
password: userPythonGateway
4444
email: userPythonGateway@dolphinscheduler.com
45-
tenant: zhongjiajie
45+
tenant: tenant_pydolphin
4646
phone: 11111111111
4747
state: 1
4848
# Default value for dolphinscheduler's workflow object

src/pydolphinscheduler/models/meta.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/pydolphinscheduler/utils/encode.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/core/test_workflow.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from pydolphinscheduler.core.resource import Resource
2929
from pydolphinscheduler.core.workflow import Workflow
3030
from pydolphinscheduler.exceptions import PyDSParamException
31-
from pydolphinscheduler.models import Project, Tenant, User
31+
from pydolphinscheduler.models import Project, User
3232
from pydolphinscheduler.tasks.switch import Branch, Default, Switch, SwitchCondition
3333
from pydolphinscheduler.utils.date import conv_to_schedule
3434
from 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-
486458
def test_schedule_json_none_schedule():
487459
"""Test function schedule_json with None as schedule."""
488460
with Workflow(

tests/test_configuration.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ def test_get_configs_build_in():
181181
"userPythonGateway@dolphinscheduler.com",
182182
"userPythonGateway@edit.com",
183183
),
184+
("default.user.tenant", "tenant_pydolphin", "edit_tenant_pydolphin"),
184185
("default.user.phone", 11111111111, 22222222222),
185186
("default.user.state", 1, 0),
186187
("default.workflow.project", "project-pydolphin", "eidt-project-pydolphin"),
187-
("default.workflow.tenant", "tenant_pydolphin", "edit_tenant_pydolphin"),
188188
("default.workflow.user", "userPythonGateway", "editUserPythonGateway"),
189189
("default.workflow.queue", "queuePythonGateway", "editQueuePythonGateway"),
190190
("default.workflow.worker_group", "default", "specific"),
@@ -220,7 +220,6 @@ def test_single_config_get_set_not_exists_key():
220220
("USER_PHONE", "11111111111"),
221221
("USER_STATE", 1),
222222
("WORKFLOW_PROJECT", "project-pydolphin"),
223-
("WORKFLOW_TENANT", "tenant_pydolphin"),
224223
("WORKFLOW_USER", "userPythonGateway"),
225224
("WORKFLOW_QUEUE", "queuePythonGateway"),
226225
("WORKFLOW_WORKER_GROUP", "default"),
@@ -249,7 +248,6 @@ def test_get_configuration(config_name: str, expect: Any):
249248
("USER_PHONE", "11111111111", "22222222222"),
250249
("USER_STATE", 1, 0),
251250
("WORKFLOW_PROJECT", "project-pydolphin", "env-project-pydolphin"),
252-
("WORKFLOW_TENANT", "tenant_pydolphin", "env-tenant_pydolphin"),
253251
("WORKFLOW_USER", "userPythonGateway", "envUserPythonGateway"),
254252
("WORKFLOW_QUEUE", "queuePythonGateway", "envQueuePythonGateway"),
255253
("WORKFLOW_WORKER_GROUP", "default", "custom"),

tests/utils/test_yaml_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"default.user.state": (1, 0),
5959
"default.workflow": yaml.load("no need test"),
6060
"default.workflow.project": ("project-pydolphin", "project-pydolphinEdit"),
61-
"default.workflow.tenant": ("tenant_pydolphin", "SmithEdit"),
6261
"default.workflow.user": ("userPythonGateway", "SmithEdit"),
6362
"default.workflow.queue": ("queuePythonGateway", "queueEdit"),
6463
"default.workflow.worker_group": ("default", "wgEdit"),

0 commit comments

Comments
 (0)