示例#1
0
def test_request_retry_skip(caplog):
    client = Client(VERIFY_WEBUI_CERTIFICATE=False)
    _ = client.app.version  # do the login first
    with caplog.at_level(logging.DEBUG, logger="qbittorrentapi"):
        with pytest.raises(exceptions.MissingRequiredParameters400Error):
            client.torrents_rename()
    assert "Retry attempt" not in caplog.text
示例#2
0
def test_verbose_logging(caplog):
    client = Client(VERBOSE_RESPONSE_LOGGING=True,
                    VERIFY_WEBUI_CERTIFICATE=False)
    with caplog.at_level(logging.DEBUG, logger="qbittorrentapi"):
        with pytest.raises(exceptions.NotFound404Error):
            client.torrents_rename(hash="asdf", new_torrent_name="erty")
    assert "Response status" in caplog.text
示例#3
0
def test_verbose_logging(caplog):
    client = Client(VERBOSE_RESPONSE_LOGGING=True)
    with caplog.at_level(logging.DEBUG, logger='qbittorrentapi'):
        with pytest.raises(NotFound404Error):
            client.torrents_rename(hash='asdf', new_torrent_name='erty')
    assert 'Response status' in caplog.text