Exemplo n.º 1
0
def test_get_wrong_key(channel_param):
    if channel_param.access == "public":
        pytest.skip()
    ch = Channel(id=channel_param.id, api_key="wrong_key")
    with pytest.raises(requests.exceptions.HTTPError) as excinfo:
        ch.get()
    excinfo.match(r"400 .*")
Exemplo n.º 2
0
def test_get_without_key(channel_param):
    ch = Channel(id=channel_param.id)
    if channel_param.access == "private":
        with pytest.raises(requests.exceptions.HTTPError) as excinfo:
            ch.get()
        excinfo.match(r"400 .*")
    else:
        result = json.loads(ch.get())
        assert type(result) == dict
Exemplo n.º 3
0
def test_get_with_key(channel_param):
    ch = Channel(id=channel_param.id, api_key=channel_param.api_key)
    result = json.loads(ch.get())
    assert type(result) == dict