• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# coding=utf-8
2#
3# Copyright (c) 2025 Huawei Device Co., Ltd.
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16from taihe.utils.resources import DeploymentMode, ResourceLocator
17
18
19def test_dev():
20    p = "repo_root/compiler/taihe/utils/resources.py"
21    loc = ResourceLocator.detect(p)
22    pass
23    assert loc.root_dir.name == "repo_root"
24
25
26def test_pkg():
27    p = ".venv/lib/python3.12/site-packages/taihe/utils/resources.py"
28    loc = ResourceLocator.detect(p)
29    pass
30    assert loc.root_dir.name == "taihe"
31
32
33def test_bundle():
34    p = "taihe-pkg/lib/pyrt/lib/python3.11/site-packages/taihe/utils/resources.py"
35    loc = ResourceLocator.detect(p)
36    pass
37    assert loc.root_dir.name == "taihe-pkg"