def test_creation(): env = 'develop' load_config(env) init(CONFIG) x, y = get_quota("test_id") update_access_count("test_id") print x, y
def test_request(self): os.environ["ASYNC_TEST_TIMEOUT"] = "60" print(self.get_url('/')) load_config("develop") init(CONFIG) headers = { "app_key": "34363bc78d6c", "app_id": "e3f9e83a-91df-11e6-852f", } params = { "media_name": "test media - zh", "addr": "http://xiaobandeng-staging.oss-cn-hangzhou.aliyuncs.com/pipeline_videos/王东岳上午音频160-end.mp3", "lan": "zh", "company": "Ailingual", } query_string = urllib.urlencode(params) response = self.fetch(('/transcribe?%s' % query_string), method='GET', headers=headers, connect_timeout=60, request_timeout=60) print(response) print(response.body) self.assertEqual(response.code, 200) assert hasattr(response.body, "data")
def test_creation(): env = 'develop' load_config(env) init(CONFIG) user_mgr = UserMgr() return user_mgr.create_company("test_company", "test_company", "abc123")
def load_env(env="staging"): load_config(env) init(CONFIG)
# coding:utf8 from __future__ import absolute_import from xiaobandeng.config import load_config from xiaobandeng.lean_cloud import init from xiaobandeng.config import CONFIG import leancloud env = 'product' load_config(env) init(CONFIG) CLASS_NAME = 'EditorTask' lean_cloud_class = leancloud.Object.extend(CLASS_NAME) query = lean_cloud_class.query query.add_ascending("createdAt") query.limit(1000) obj_list = query.find() print 'total:', len(obj_list) # obj = obj_list[0] for obj in obj_list: acl = leancloud.ACL() acl.set_public_read_access(True) acl.set_public_write_access(True) obj.set_acl(acl)