-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5804a6c
commit 43647c0
Showing
11 changed files
with
276 additions
and
260 deletions.
There are no files selected for viewing
151 changes: 0 additions & 151 deletions
151
src/dashboard/apigateway/apigateway/apis/open/esb/permission/helpers.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/dashboard/apigateway/apigateway/editions/ee/tests/apps/esb/bkcore/test_managers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# TencentBlueKing is pleased to support the open source community by making | ||
# 蓝鲸智云 - API 网关(BlueKing - APIGateway) available. | ||
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. | ||
# Licensed under the MIT License (the "License"); you may not use this file except | ||
# in compliance with the License. You may obtain a copy of the License at | ||
# | ||
# http://opensource.org/licenses/MIT | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under | ||
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
# either express or implied. See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# We undertake not to change the open source license (MIT license) applicable | ||
# to the current version of the project delivered to anyone in the future. | ||
# | ||
from ddf import G | ||
|
||
from apigateway.apps.esb.bkcore.models import AppComponentPermission | ||
from apigateway.utils.time import to_datetime_from_now | ||
|
||
|
||
class TestAppComponentPermissionManager: | ||
def test_renew_permissions(self, unique_id): | ||
perm = G( | ||
AppComponentPermission, | ||
bk_app_code=unique_id, | ||
component_id=1, | ||
expires=to_datetime_from_now(days=100), | ||
) | ||
|
||
AppComponentPermission.objects.renew_permissions(unique_id, [1], 70) | ||
perm.refresh_from_db() | ||
to_datetime_from_now(days=99) < perm.expires < to_datetime_from_now(days=101) | ||
|
||
AppComponentPermission.objects.renew_permissions(unique_id, [1], 170) | ||
perm.refresh_from_db() | ||
to_datetime_from_now(days=160) < perm.expires < to_datetime_from_now(days=180) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.