Skip to content

Commit 72de3d7

Browse files
authored
prepare release 1.0.2 (#49)
* Prepare version: 1.0.2 * Cleanup test case * split code and config
1 parent a70ec80 commit 72de3d7

File tree

5 files changed

+37
-27
lines changed

5 files changed

+37
-27
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[bumpversion]
22
commit = True
33
tag = False
4-
current_version = 1.0.1
4+
current_version = 1.0.2
55

66
[bumpversion:file:setup.py]

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22

33
## Unreleased
44

5-
---
6-
75
### New
86

97
### Changes
108

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

1411
### Breaks
1512

13+
## 1.0.2 - (2021-09-02)
14+
15+
---
16+
17+
### Fixes
18+
19+
* fix #48 - raise PHPyPAMEntityNotFoundException if searching for non existing host
20+
1621
## 1.0.1 - (2021-01-04)
1722

1823
### New

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="phpypam",
8-
version="1.0.1",
8+
version="1.0.2",
99
author="Christian Meißner",
1010
author_email="Christian Meißner <[email protected]>",
1111
description="Python API client library for phpIPAM installation",

tests/test_cases/search_exceptions.py

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,11 @@
88
from phpypam.core.exceptions import PHPyPAMException, PHPyPAMEntityNotFoundException
99

1010

11-
with open('tests/vars/server.yml') as c:
12-
server = yaml.safe_load(c)
13-
14-
connection_params = dict(
15-
url=server['url'],
16-
app_id=server['app_id'],
17-
username=server['username'],
18-
password=server['password'],
19-
ssl_verify=True
20-
)
21-
22-
not_found_cases = [
23-
dict(controller='subnets', path='cidr/1.2.3.4', params=None),
24-
dict(controller='addresses', path='search/1.2.3.4'),
25-
dict(controller='vlans', path='/1337'),
26-
dict(controller='vrf'),
27-
dict(controller='devices', path='/1337'),
28-
dict(controller='sections', params={'filter_by': 'name', 'filter_value': 'not_existing_section', 'filter_match': 'full'}),
29-
dict(controller='tools/device_types', path='/1337'),
30-
dict(controller='addresses', path='search_hostname/not_existing_hostname')
31-
]
11+
with open('tests/vars/server.yml') as conn:
12+
connection_params = yaml.safe_load(conn)
13+
14+
with open('tests/vars/search_exceptions.yml') as config:
15+
not_found_cases = yaml.safe_load(config)['not_found_cases']
3216

3317

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

5337
# assert exception message is in all not found outputs
54-
assert e.value.args[0] in PHPyPAMException._NOT_FOUND_MESSAGES
38+
assert str(e.value) in PHPyPAMException._NOT_FOUND_MESSAGES

tests/vars/search_exceptions.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
not_found_cases:
3+
- controller: subnets
4+
params: null
5+
path: cidr/1.2.3.4
6+
- controller: addresses
7+
path: search/1.2.3.4
8+
- controller: vlans
9+
path: /1337
10+
- controller: vrf
11+
- controller: devices
12+
path: /1337
13+
- controller: sections
14+
params:
15+
filter_by: name
16+
filter_match: full
17+
filter_value: not_existing_section
18+
- controller: tools/device_types
19+
path: /1337
20+
- controller: addresses
21+
path: search_hostname/not_existing_hostname

0 commit comments

Comments
 (0)