Skip to content

Commit aed701d

Browse files
committed
check
1 parent 62d710e commit aed701d

9 files changed

Lines changed: 374 additions & 53 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,11 @@ jobs:
2323
python -m pip install --upgrade pip
2424
pip install setuptools wheel twine
2525
- name: Build and publish
26+
2627
run: |
2728
python setup.py sdist bdist_wheel
29+
env:
30+
PYTEST_TOKEN: ${{ secrets.PYTEST_TOKEN }}
31+
run: |
32+
export PYTEST_TOKEN = "%PYTEST_TOKEN%"
33+
pytest

bytesviewapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from bytesviewapi.bytesviewapi_client import BytesviewapiClient
1+
from bytesviewapi.bytesviewapi_client import BytesviewApiClient

bytesviewapi/api_authentication.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,28 @@
22

33

44
class BytesApiAuth(AuthBase):
5-
# Provided by newsapi: https://newsapi.org/docs/authentication
5+
""" BytesviewApi authorization header update """
6+
7+
"""
8+
:param api_key: your API key.
9+
:type api_key: string
10+
"""
11+
612
def __init__(self, api_key):
713
self.api_key = api_key
14+
815

916
def __call__(self, request):
10-
request.headers.update(get_auth_headers(self.api_key))
17+
request.headers.update(api_headers(self.api_key))
1118
return request
1219

1320

14-
def get_auth_headers(api_key):
15-
return {"Content-Type": "Application/JSON", "x-access-tokens": api_key}
21+
def api_headers(api_key):
22+
""" Return API request header"""
23+
return {
24+
"Content-Type": "Application/JSON",
25+
"x-access-token": api_key
26+
}
1627

1728

1829

0 commit comments

Comments
 (0)