Skip to content

Commit

Permalink
0.2.1 (2024-03-29)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirs-git committed Mar 29, 2024
1 parent 7858e35 commit ecd7ffb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
CHANGELOG
=========

0.3.0 (2024-03-29)
0.2.1 (2024-03-29)
------------------

**Changed:** NbParser.join_tree)
**Fixed:** BaseC._slice_params_counters()
**Changed:** NbForager.clear(root, tree)
**Changed:** NbForager.join_tree(dcim, ipam)


0.2.0 (2024-03-11)
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
project = "nbforager"
copyright = "2023, Vladimirs Prusakovs"
author = "Vladimirs Prusakovs"
release = "0.3.0"
release = "0.2.1"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
3 changes: 0 additions & 3 deletions nbforager/api/base_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,6 @@ def _slice_params_counters(self, results: LDAny) -> LDAny:
params_d = result["params_d"]
if not result["count"]:
continue
if count <= self.limit:
params.append(params_d)
continue
params_: LDAny = h.generate_offsets(count, self.limit, params_d)
params.extend(params_)
return params
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nbforager"
version = "0.3.0"
version = "0.2.1"
description = "Python package designed to assist in working with the Netbox REST API. The filter parameters are identical to those in the Web UI filter form. It replaces brief data with full information, and Netbox objects are represented as a recursive multidimensional dictionary."
authors = ["Vladimirs Prusakovs <[email protected]>"]
readme = "README.rst"
Expand Down Expand Up @@ -54,7 +54,7 @@ test = ["pytest"]

[tool.poetry.urls]
"Bug Tracker" = "https://github.com/vladimirs-git/nbforager/issues"
"Download URL" = "https://github.com/vladimirs-git/nbforager/archive/refs/tags/0.3.0.tar.gz"
"Download URL" = "https://github.com/vladimirs-git/nbforager/archive/refs/tags/0.2.1.tar.gz"

[tool.pylint]
max-line-length = 100
Expand Down
12 changes: 12 additions & 0 deletions tests/api_/test__base_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,18 @@ def test__msg_status_code__none(api: NbApi):
assert actual == ""


@pytest.mark.parametrize("results, expected", [
([], []),
([{"count": 1, "params_d": {}}], [{"limit": 1000, "offset": 0}]),
([{"count": 1001, "params_d": {}}],
[{"limit": 1000, "offset": 0}, {"limit": 1000, "offset": 1000}]),
])
def test__slice_params_counters(api: NbApi, results: LDAny, expected: LDAny):
"""BaseC._slice_params_counters()."""
actual = api.ipam.ip_addresses._slice_params_counters(results=results)
assert actual == expected


@pytest.mark.parametrize("kwargs, expected", [
({}, ValueError),
({"host": ""}, ValueError),
Expand Down

0 comments on commit ecd7ffb

Please sign in to comment.