-
Notifications
You must be signed in to change notification settings - Fork 524
Remove dsn.lower() from influxdb08.InfluxDBClient.from_DSN() #190
Conversation
Thanks for spotting that. Could you add to the Thanks. |
In my opinion these kinds of problems are easiest to capture by using the existing tests, but changing the case-sensitive fields ( So for example tests/influxdb/influxdb08/client_test.py#L102 would change from Also, for easier change (and avoiding typos) the "base url" should be one variable, instead of rewriting it all the time (e.g. I can try and do this today or tomorrow, but if this is the way to go, I'd rather create another pull request, as it affects multiple tests (I'd also do the changes to 0.9 at the same time). |
Use `DSN_STRING` and `CLUSTER_DSN_STRING` instead of rewriting the whole string. Makes it easier to change, if and when tests are developed. Change all `assert .* == .*`, `assert .* is True` and `assert .* is False` to use `assertEqual`, `assertTrue` and `assertFalse`. This is mainly for consistency, no "real" reason. Discussed in PR influxdata#190.
Use `DSN_STRING` and `CLUSTER_DSN_STRING` instead of rewriting the whole string. Makes it easier to change, if and when tests are developed. Change all `assert .* == .*`, `assert .* is True` and `assert .* is False` to use `assertEqual`, `assertTrue` and `assertFalse`. This is mainly for consistency, no "real" reason. Discussed in PR influxdata#190. Fails tests, as long as that issue is merged (this commit fixes tests for that issue also).
Use `DSN_STRING` and `CLUSTER_DSN_STRING` instead of rewriting the whole string. Makes it easier to change, if and when tests are developed. Change all `assert .* == .*`, `assert .* is True` and `assert .* is False` to use `assertEqual`, `assertTrue` and `assertFalse`. This is mainly for consistency, no "real" reason.
Just added some refactoring of the tests, which also modify the tests to include the situation this pull request fixes. |
@@ -29,6 +29,9 @@ | |||
from influxdb import InfluxDBClient, InfluxDBClusterClient | |||
from influxdb.client import InfluxDBServerError | |||
|
|||
DSN_STRING = 'influxdb://uSr:pWd@host:1886/db' | |||
CLUSTER_DSN_STRING = 'influxdb://uSr:pWd@host1:8086,uSr:pWd@host2:8086/db' |
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.
Can you declare this in a set_up instead? I prefer not to have class-level attributes
Good point, changed as requested :) |
Thank you for your contributon @kipe ! @ChristopherRabotin Is that good to you? |
Yes, that looks good. Thanks for asking. On Mon, Jun 1, 2015, 19:22 Alexandre Viau notifications@github.com wrote:
|
Remove dsn.lower() from influxdb08.InfluxDBClient.from_DSN()
InfluxDBClient.from_DSN() now behaves correctly and allows (for example) case-sensitive password.