forked from leancloud/python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_client.py
More file actions
38 lines (26 loc) · 949 Bytes
/
Copy pathtest_client.py
File metadata and controls
38 lines (26 loc) · 949 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
31
32
33
34
35
36
37
38
# coding: utf-8
import os
import datetime
import leancloud
from leancloud import client
__author__ = 'asaka'
def test_use_production():
assert client.USE_PRODUCTION == '1'
leancloud.use_production(False)
assert client.USE_PRODUCTION == '0'
leancloud.use_production(True)
assert client.USE_PRODUCTION == '1'
def test_use_master_key():
leancloud.init(os.environ['APP_ID'], os.environ['APP_KEY'], os.environ['MASTER_KEY'])
assert client.USE_MASTER_KEY is None
leancloud.use_master_key(True)
assert client.USE_MASTER_KEY is True
leancloud.use_master_key(False)
assert client.USE_MASTER_KEY is False
# def test_get_base_url():
# leancloud.use_https(False)
# assert client.get_base_url().startswith('http://')
# leancloud.use_https(True)
# assert client.get_base_url().startswith('https://')
def test_get_server_time():
assert type(client.get_server_time()) == datetime.datetime