Exemplo n.º 1
0
def hello(**params):
    if 'name' in params:
        return 'Hello, {}!'.format(params['name'])
    else:
        leancloud.use_production(os.environ['LEANCLOUD_APP_ENV'] == 'production')
        leancloud.init("3AJTBW5QyGw17hLxNN3njGHW-gzGzoHsz", "P8cKdEvRxusfuR27MuhvFOzr")
        todo = leancloud.Object.extend('Todo')()
        todo.set('content', '')
        todo.save()
        return app_env
Exemplo n.º 2
0
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'
Exemplo n.º 3
0
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'
Exemplo n.º 4
0
def test_use_production():  # type: () -> None
    assert client.USE_PRODUCTION == "1"
    leancloud.use_production(False)
    assert client.USE_PRODUCTION == "0"
    leancloud.use_production(True)
    assert client.USE_PRODUCTION == "1"