forked from ucloud/ucloud-sdk-python2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.py
More file actions
30 lines (19 loc) · 708 Bytes
/
env.py
File metadata and controls
30 lines (19 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-
import os
ACC_ENV_KEY = "USDKACC"
ACC_SKIP_REASON = "skip test for non-acc environment"
def get_skip_reason():
return ACC_SKIP_REASON
def is_acc():
""" check test env is acceptance testing or not """
return os.getenv(ACC_ENV_KEY)
def is_ut():
""" check test env is unit testing or not """
return not is_acc()
def pre_check_env():
""" pre check environment for testing
NOTE: system environment variables credential is required for test environment
"""
assert os.getenv("UCLOUD_PUBLIC_KEY"), "invalid public key"
assert os.getenv("UCLOUD_PRIVATE_KEY"), "invalid private key"
assert os.getenv("UCLOUD_PROJECT_ID"), "invalid region"