Exemplo n.º 1
0
def test_check_endpoint_params_nok():
    """Check parameters - invalid params passed"""
    with pytest.raises(InvalidEndpointParameters) as exc:
        ShaarliV1Client._check_endpoint_params('get-links', {
            'get': 27,
            'forget': 31
        })
    assert "'get-links':" in str(exc.value)
    assert 'get' in str(exc.value)
    assert 'forget' in str(exc.value)
Exemplo n.º 2
0
def test_check_endpoint_params_nok_mixed():
    """Check parameters - valid & invalid params passed"""
    with pytest.raises(InvalidEndpointParameters) as exc:
        ShaarliV1Client._check_endpoint_params('get-links', {
            'offset': 200,
            'preset': 27,
            'headset': 31
        })
    assert "'get-links':" in str(exc.value)
    assert 'headset' in str(exc.value)
    assert 'preset' in str(exc.value)
Exemplo n.º 3
0
def test_check_endpoint_params_ok():
    """Check parameters - valid params passed"""
    ShaarliV1Client._check_endpoint_params('get-links', {
        'offset': 3,
        'limit': 100
    })
Exemplo n.º 4
0
def test_check_endpoint_params_empty():
    """Check parameters - empty dict passed"""
    ShaarliV1Client._check_endpoint_params('get-info', {})
Exemplo n.º 5
0
def test_check_endpoint_params_none():
    """Check parameters - none passed"""
    ShaarliV1Client._check_endpoint_params('get-info', None)