1#!/usr/bin/env python3
2# coding=utf-8
3
4#
5# Copyright (c) 2022 Huawei Device Co., Ltd.
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10#     http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19import os
20
21
22class DTConstants():
23    FAILED = 'failed'
24    PASSED = 'passed'
25
26
27class RunSection(object):
28    SETUP = "SETUP"
29    TEST = "TEST"
30    TEARDOWN = "TEARDOWN"
31
32
33class RunStatus(object):
34    INITING = "Initing"
35    RUNNING = "Running"
36    STOPPED = "Stopped"
37    FINISHED = "Finished"
38
39
40class RunResult(object):
41    PASSED = "Passed"
42    FAILED = "Failed"
43    BLOCKED = "Blocked"
44    NORUN = "NORUN"
45
46
47class FileAttribute:
48    TESTCASE_PREFIX = "TC_"
49    TESTCASE_POSFIX_PY = ".py"
50    TESTCASE_POSFIX_PYC = ".pyc"
51    TESTCASE_POSFIX_PYD = ".pyd"
52
53
54class DeviceConstants:
55    RECONNECT_TIMES = 3  # 断链,默认重连次数
56    HOST = os.environ.get('AP_HOST', "127.0.0.1")
57    PORT = os.environ.get('AP_PORT', 9999)
58    OH_DEVICETEST_BUNDLE_NAME = "com.ohos.devicetest."
59    RES_VERSION = "002"
60
61
62class DeviceTestMode:
63    MODE = "device_test_mode"
64    HYPIUM_PERF_TEST = "hypium_perf_test"
65