Skip to content

Commit

Permalink
feature: 提供 Agent 包管理后台接口 (closed TencentBlueKing#1683)
Browse files Browse the repository at this point in the history
  • Loading branch information
ping15 committed Nov 23, 2023
1 parent 5b33b0f commit 8f071d1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/node_man/tests/test_views/test_package_manage_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ def test_list_with_filter_condition(self, *args, **kwargs):

# 筛选os_cpu_arch
os, cpu_arch = "linux", "x86_64"
result = self.client.get(path="/api/agent/package/",
data={"os_cpu_arch": f"{gse_package.os}_{gse_package.cpu_arch}"})
result = self.client.get(
path="/api/agent/package/", data={"os_cpu_arch": f"{gse_package.os}_{gse_package.cpu_arch}"}
)
self.assertEqual(len(result["data"]["list"]), 1)
self.assertEqual(result["data"]["list"][0]["os"], os)
self.assertEqual(result["data"]["list"][0]["cpu_arch"], cpu_arch)
Expand Down Expand Up @@ -137,7 +138,7 @@ def test_update(self, *args, **kwargs):
self.assertEqual(GsePackages.objects.first().is_ready, False)

# 测试更新不存在的id是否服务器异常
self.client.put(path=f"/api/agent/package/10000/", data={"is_ready": False})
self.client.put(path="/api/agent/package/10000/", data={"is_ready": False})

@patch("apps.node_man.permissions.package_manage.PackageManagePermission.has_permission", return_value=True)
def test_destroy(self, *args, **kwargs):
Expand All @@ -147,7 +148,7 @@ def test_destroy(self, *args, **kwargs):
self.assertEqual(len(GsePackages.objects.all()), 0)

# 测试删除存在的id是否服务器异常
self.client.delete(path=f"/api/agent/package/10000/")
self.client.delete(path="/api/agent/package/10000/")

@patch("apps.node_man.permissions.package_manage.PackageManagePermission.has_permission", return_value=True)
def test_quick_search_condition(self, *args, **kwargs):
Expand Down

0 comments on commit 8f071d1

Please sign in to comment.