Skip to content

Commit

Permalink
prepare release 1.0.2 (#49)
Browse files Browse the repository at this point in the history
* Prepare version: 1.0.2
* Cleanup test case
* split code and config
  • Loading branch information
cmeissner authored Sep 6, 2021
1 parent a70ec80 commit 72de3d7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[bumpversion]
commit = True
tag = False
current_version = 1.0.1
current_version = 1.0.2

[bumpversion:file:setup.py]
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@

## Unreleased

---

### New

### Changes

### Fixes
* fix #48 - raise PHPyPAMEntityNotFoundException if searching for non existing host

### Breaks

## 1.0.2 - (2021-09-02)

---

### Fixes

* fix #48 - raise PHPyPAMEntityNotFoundException if searching for non existing host

## 1.0.1 - (2021-01-04)

### New
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="phpypam",
version="1.0.1",
version="1.0.2",
author="Christian Meißner",
author_email="Christian Meißner <[email protected]>",
description="Python API client library for phpIPAM installation",
Expand Down
28 changes: 6 additions & 22 deletions tests/test_cases/search_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,11 @@
from phpypam.core.exceptions import PHPyPAMException, PHPyPAMEntityNotFoundException


with open('tests/vars/server.yml') as c:
server = yaml.safe_load(c)

connection_params = dict(
url=server['url'],
app_id=server['app_id'],
username=server['username'],
password=server['password'],
ssl_verify=True
)

not_found_cases = [
dict(controller='subnets', path='cidr/1.2.3.4', params=None),
dict(controller='addresses', path='search/1.2.3.4'),
dict(controller='vlans', path='/1337'),
dict(controller='vrf'),
dict(controller='devices', path='/1337'),
dict(controller='sections', params={'filter_by': 'name', 'filter_value': 'not_existing_section', 'filter_match': 'full'}),
dict(controller='tools/device_types', path='/1337'),
dict(controller='addresses', path='search_hostname/not_existing_hostname')
]
with open('tests/vars/server.yml') as conn:
connection_params = yaml.safe_load(conn)

with open('tests/vars/search_exceptions.yml') as config:
not_found_cases = yaml.safe_load(config)['not_found_cases']


@vcr.use_cassette(cassette_name('test_entity_not_found_exception'),
Expand All @@ -51,4 +35,4 @@ def test_entity_not_found_exception(case):
pi.get_entity(case['controller'], controller_path=case.pop('path', None), params=case.pop('params', None))

# assert exception message is in all not found outputs
assert e.value.args[0] in PHPyPAMException._NOT_FOUND_MESSAGES
assert str(e.value) in PHPyPAMException._NOT_FOUND_MESSAGES
21 changes: 21 additions & 0 deletions tests/vars/search_exceptions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
not_found_cases:
- controller: subnets
params: null
path: cidr/1.2.3.4
- controller: addresses
path: search/1.2.3.4
- controller: vlans
path: /1337
- controller: vrf
- controller: devices
path: /1337
- controller: sections
params:
filter_by: name
filter_match: full
filter_value: not_existing_section
- controller: tools/device_types
path: /1337
- controller: addresses
path: search_hostname/not_existing_hostname

0 comments on commit 72de3d7

Please sign in to comment.