-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow query parameters on endpoints. Fix various endpoints. #172
Changes from all commits
dd9ae79
0fef856
d9f7110
4144e92
443194e
d341a2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
from grafana_client.api import GrafanaApi | ||
from grafana_client.client import ( | ||
GrafanaClientError, | ||
GrafanaServerError, | ||
GrafanaTimeoutError, | ||
HeaderAuth, | ||
TokenAuth, | ||
|
@@ -95,6 +96,7 @@ def test_grafana_client_no_verify(self): | |
auth=basic_auth, | ||
headers=None, | ||
json=None, | ||
params=None, | ||
data=None, | ||
verify=False, | ||
timeout=5.0, | ||
|
@@ -160,7 +162,7 @@ def test_grafana_client_version(self, mock_get): | |
|
||
def test_grafana_client_non_json_response(self): | ||
grafana = GrafanaApi.from_url("https://example.org/") | ||
self.assertRaises(GrafanaClientError, lambda: grafana.connect()) | ||
self.assertRaises((GrafanaClientError, GrafanaServerError), lambda: grafana.connect()) | ||
Comment on lines
-163
to
+165
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Indeed, example.org, on its HTTP/1.1 404 Not Foundhttp HEAD https://example.org/api/foo HTTP/1.1 500 Internal Server Errorhttp HEAD https://example.org/api/bar It's weird, but c'est la vie, right? |
||
|
||
def test_grafana_client_204_no_content_response(self): | ||
grafana = GrafanaApi.from_url() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this was missing, right? Thanks for spotting, and fixing per 4144e92!
Maybe we can come up with an idea and routine to prevent such details slipping through on future occasions, on behalf of
script/generate_async.py
, if it's not too much of a hassle?/cc @Ousret
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be easy to implement, yes.
There's another option, a bit more straightforward (without generate_async.py): "getattr + module async inspect" on init to check if one api is missing in both sync and async. then raise a warning or error.
regards,