-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
92 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "ulauncher-toggl-extension" | ||
version = "2.6.3" | ||
version = "2.7.1" | ||
description = "Toggl time tracker extension for Ulauncher." | ||
authors = ["David Kasakaitis <[email protected]>"] | ||
readme = "README.md" | ||
|
@@ -140,6 +140,21 @@ basepython = python3.12 | |
commands = ruff check ulauncher_toggl_extension/ | ||
""" | ||
|
||
[tool.coverage.run] | ||
omit = [ | ||
"*/tests/*", | ||
"*/.venv/*", | ||
"*/.mypy_cache/*", | ||
"*/.ruff_cache/*", | ||
"*/.pytest_cache/*", | ||
"docs/*", | ||
"scripts/*", | ||
"*/.github/*", | ||
"*/.tox/*", | ||
"*/.git/*", | ||
] | ||
|
||
|
||
[tool.coverage.report] | ||
exclude_also = [ | ||
"def __repr__", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pytest | ||
|
||
from ulauncher_toggl_extension.commands.tracker import ListCommand | ||
|
||
|
||
@pytest.mark.unit | ||
@pytest.mark.parametrize( | ||
("data", "static"), | ||
[(12, 0), (1, 0), (10, 2), (15, 1), (0, 0), (200, 2)], | ||
) | ||
def test_cmd_paginator(data, static, dummy_ext, dummy_query_parameters): | ||
params = dummy_query_parameters(data) | ||
|
||
static_param = dummy_query_parameters(static) | ||
|
||
cmd = ListCommand(dummy_ext) | ||
|
||
total = 0 | ||
page = 1 | ||
per_page = dummy_ext.max_results - (static + 1) | ||
while total < data: | ||
paginator = cmd._paginator([], params, static_param, page=page) # noqa: SLF001 | ||
assert all( | ||
p.name == e.name and p.description == e.description | ||
for p, e in zip(paginator[:per_page], params[per_page * page : per_page]) | ||
) | ||
total += min(per_page, len(paginator)) | ||
page += 1 | ||
|
||
assert total == data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "2.7.0" | ||
__version__ = "2.7.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters