Skip to content

Commit 894703c

Browse files
authored
Merge pull request #201 from gdubicki/pql
Add PQL support, refactor and reorganize code
2 parents 1f474f8 + 2b0ba7e commit 894703c

25 files changed

+2340
-1778
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
pip install -r requirements-test.txt
2424
- name: Test
2525
run: |
26-
pytest --pep8 --mypy --strict
26+
pytest --pep8 --strict
2727
- name: Run coveralls
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ do this to run the tests:
4444

4545
```bash
4646
# Unit tests
47-
py.test
47+
py.test --pep8 --strict
4848
# Security linter
4949
bandit -r pypuppetdb
5050
```

conftest.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
# Set up our API objects
66
@pytest.fixture
7-
def baseapi():
8-
return pypuppetdb.api.BaseAPI()
7+
def api():
8+
return pypuppetdb.api.API()
99

1010

1111
@pytest.fixture
12-
def token_baseapi():
13-
return pypuppetdb.api.BaseAPI(token='tokenstring')
12+
def token_api():
13+
return pypuppetdb.api.API(token='tokenstring')
1414

1515

1616
@pytest.fixture

pypuppetdb/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"""
5959
import logging
6060

61-
from pypuppetdb.api import BaseAPI
61+
from pypuppetdb.api import API
6262

6363
logging.getLogger(__name__).addHandler(logging.NullHandler())
6464

@@ -109,7 +109,7 @@ def connect(host='localhost', port=8080, ssl_verify=False, ssl_key=None,
109109
:param token: (optional) The x-auth token to use for X-Authentication
110110
:type token: :obj:`None` or :obj:`string`
111111
"""
112-
return BaseAPI(host=host, port=port,
113-
timeout=timeout, ssl_verify=ssl_verify, ssl_key=ssl_key,
114-
ssl_cert=ssl_cert, protocol=protocol, url_path=url_path,
115-
username=username, password=password, token=token)
112+
return API(host=host, port=port,
113+
timeout=timeout, ssl_verify=ssl_verify, ssl_key=ssl_key,
114+
ssl_cert=ssl_cert, protocol=protocol, url_path=url_path,
115+
username=username, password=password, token=token)

0 commit comments

Comments
 (0)