From 8cf8c7cb49e4669fa012abae6d4d502b69dde630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E7=AC=91?= <7922647+ly-qianxiao@user.noreply.gitee.com> Date: Sat, 21 Jun 2025 10:06:04 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20utils?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/.keep diff --git a/plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/.keep b/plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/.keep new file mode 100644 index 00000000000..e69de29bb2d -- Gitee From 721543ec3a9144f49341288be413e654f4180ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E7=AC=91?= <7922647+ly-qianxiao@user.noreply.gitee.com> Date: Sat, 21 Jun 2025 10:06:40 +0000 Subject: [PATCH 2/3] add plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 浅笑 <7922647+ly-qianxiao@user.noreply.gitee.com> --- .../tb_graph_ascend/test/unit/utils/test_global_state | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/test_global_state diff --git a/plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/test_global_state b/plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/test_global_state new file mode 100644 index 00000000000..e69de29bb2d -- Gitee From 17549004d59596e6cb62f9490f8a9f913ff66c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E7=AC=91?= <7922647+ly-qianxiao@user.noreply.gitee.com> Date: Sat, 21 Jun 2025 10:07:23 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0utils=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 浅笑 <7922647+ly-qianxiao@user.noreply.gitee.com> --- .../test/unit/utils/test_global_state | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/test_global_state b/plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/test_global_state index e69de29bb2d..c8aa01b01af 100644 --- a/plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/test_global_state +++ b/plugins/tensorboard-plugins/tb_graph_ascend/test/unit/utils/test_global_state @@ -0,0 +1,34 @@ +# Copyright (c) 2025, Huawei Technologies. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# ============================================================================== + +import unittest +from server.app.utils.global_state import GraphState + +class TestGlobalState(unittest.TestCase): + def setUp(self): + GraphState.init_defaults() + + def test_set_global_value(self): + GraphState.set_global_value('logdir', "./") + assert GraphState.get_global_value("logdir") == "./" + + def test_get_global_value(self): + assert GraphState.get_global_value("logdir") == "" + + def test_reset_global_state(self): + GraphState.set_global_value('logdir', "./") + GraphState.reset_global_state() + assert GraphState.get_global_value("logdir") == "" -- Gitee