mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
minor fixes
This commit is contained in:
parent
d2c7d48a2f
commit
a969f12d20
9 changed files with 13 additions and 11 deletions
2
.github/workflows/tests.yaml
vendored
2
.github/workflows/tests.yaml
vendored
|
@ -41,7 +41,7 @@ jobs:
|
|||
if: ${{ contains(matrix.deps, 'pycurl') }}
|
||||
run: sudo apt install -y libcurl4-openssl-dev
|
||||
- name: Install Python deps
|
||||
run: pip install -U ${{ matrix.deps }} pytest pytest-asyncio pytest-httpbin flaky structlog toml appdirs
|
||||
run: pip install -U ${{ matrix.deps }} pytest pytest-asyncio pytest-httpbin flaky structlog toml appdirs lxml
|
||||
- name: Decrypt keys
|
||||
env:
|
||||
KEY: ${{ secrets.KEY }}
|
||||
|
|
|
@ -286,7 +286,7 @@ xpath
|
|||
An xpath expression used to find the version string.
|
||||
|
||||
.. note::
|
||||
An additional dependency "lxml" is required
|
||||
An additional dependency "lxml" is required.
|
||||
|
||||
Find with a Command
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
|
3
mypy.ini
3
mypy.ini
|
@ -20,3 +20,6 @@ ignore_missing_imports = True
|
|||
|
||||
[mypy-appdirs]
|
||||
ignore_missing_imports = True
|
||||
|
||||
[mypy-lxml]
|
||||
ignore_missing_imports = True
|
||||
|
|
|
@ -8,4 +8,4 @@ from .util import (
|
|||
)
|
||||
from .sortversion import sort_version_keys
|
||||
|
||||
from .ctxvars import tries, proxy, user_agent, httptoken, entry_waiter
|
||||
from .ctxvars import tries, proxy, user_agent, httptoken, entry_waiter
|
||||
|
|
|
@ -17,4 +17,4 @@ tries = ContextVar('tries', default=1)
|
|||
proxy: ContextVar[Optional[str]] = ContextVar('proxy', default=None)
|
||||
user_agent = ContextVar('user_agent', default=DEFAULT_USER_AGENT)
|
||||
httptoken = ContextVar('httptoken', default=None)
|
||||
entry_waiter: ContextVar[EntryWaiter] = ContextVar('entry_waiter')
|
||||
entry_waiter: ContextVar[EntryWaiter] = ContextVar('entry_waiter')
|
||||
|
|
|
@ -264,7 +264,6 @@ class FunctionWorker(BaseWorker):
|
|||
except Exception as e:
|
||||
await self.result_q.put(RawResult(name, e, entry))
|
||||
|
||||
|
||||
class GetVersionError(Exception):
|
||||
'''An error occurred while getting version information.
|
||||
|
||||
|
|
|
@ -18,4 +18,4 @@ async def test_xpath_missing_ok(get_version):
|
|||
"url": "http://httpbin.org/",
|
||||
"xpath": '//pre[@class="test-is-ok"]/text()',
|
||||
"missing_ok": True,
|
||||
}) is None
|
||||
}) is None
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import pytest
|
||||
import pytest_httpbin
|
||||
assert pytest_httpbin # for pyflakes
|
||||
assert pytest_httpbin # for pyflakes
|
||||
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
||||
|
||||
async def test_redirection(get_version):
|
||||
|
@ -11,7 +11,7 @@ async def test_redirection(get_version):
|
|||
"source": "httpheader",
|
||||
"url": "https://www.unifiedremote.com/download/linux-x64-deb",
|
||||
"regex": r'urserver-([\d.]+).deb',
|
||||
}) != None
|
||||
}) is not None
|
||||
|
||||
async def test_get_version_withtoken(get_version, httpbin):
|
||||
assert await get_version("unifiedremote", {
|
||||
|
@ -20,4 +20,4 @@ async def test_get_version_withtoken(get_version, httpbin):
|
|||
"httptoken": "Basic dXNlcm5hbWU6c3VwZXJwYXNzd29yZA==",
|
||||
"header": "server",
|
||||
"regex": r'([0-9.]+)*',
|
||||
}) != None
|
||||
}) is not None
|
||||
|
|
|
@ -5,7 +5,7 @@ import base64
|
|||
|
||||
import pytest
|
||||
import pytest_httpbin
|
||||
assert pytest_httpbin # for pyflakes
|
||||
assert pytest_httpbin # for pyflakes
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
@ -57,4 +57,4 @@ async def test_regex_with_tokenBearer(get_version, httpbin):
|
|||
"url": httpbin.url + "/bearer",
|
||||
"httptoken": "Bearer username:password",
|
||||
"regex": r'"token":"([a-w]+):.*"',
|
||||
}) == "username"
|
||||
}) == "username"
|
||||
|
|
Loading…
Add table
Reference in a new issue