示例#1
0
async def test_put_settings():
    old, response = await json_response(settings.get_settings(MagicMock()))
    test_key = 'peer_connect_timeout'

    async def json():
        return {test_key: old[test_key] + 1}

    request = MagicMock()
    request.configure_mock(**{
        'json.return_value': json(),
    })

    response = await settings.put_settings(request)
    assert response.status == 200

    new, response = await json_response(settings.get_settings(MagicMock()))

    assert old[test_key] != new[test_key]
    assert old[test_key] == new[test_key] - 1
示例#2
0
async def test_get_settings():
    s, response = await json_response(settings.get_settings(MagicMock()))

    assert isinstance(s, dict)
    assert len(s) > 0