Open
Conversation
houndci-bot
reviewed
May 14, 2019
tests/test_analysis.py
Outdated
| @@ -0,0 +1,52 @@ | |||
| from carto.analysis import AnalysisClient | |||
|
|
|||
| def test_analysis(api_key_auth_client_usr): | |||
|
|
||
| ANSI_ESCAPE = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]') | ||
|
|
||
| def uncolored(text): |
| attrib = ''.join([Color.COLORS[a] for a in attrib]) | ||
| return attrib + str(text) + Color.END | ||
|
|
||
| ANSI_ESCAPE = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]') |
There was a problem hiding this comment.
expected 2 blank lines after class or function definition, found 1
| def enable_colors(mode): | ||
| Color.enabled = mode | ||
|
|
||
| def colored(attrib, text): |
| @@ -0,0 +1,39 @@ | |||
| import re | |||
|
|
|||
| class Color: | |||
| ] | ||
|
|
||
|
|
||
| def update(self): |
| @staticmethod | ||
| def print(*args): | ||
| print(*args) | ||
| @staticmethod |
|
|
||
| TASK_GROUP = 'analysis' # we have always one task group named analysis | ||
|
|
||
| class DefaultOutput: |
carto/analysis.py
Outdated
| ) | ||
| res = self.auth_client.send(url, 'GET', headers=HEADERS) | ||
| logs = self.auth_client.get_response_data(res, False) | ||
| if not logs is None: |
There was a problem hiding this comment.
test for object identity should be 'is not'
| 'accept': 'application/json' | ||
| } | ||
|
|
||
| class AnalysisClient(object): |
Contributor
Author
|
The higher level API is not Python 2 compatible at the moment |
Contributor
Author
|
For consistency with other APIs I think it'll be better to rename |
andy-esch
reviewed
May 14, 2019
| if self.summary is None: | ||
| return '' | ||
| if self.type == 'now': | ||
| return 'C:{c} S:{s} F:{f} L:{l} Q:{q} R:{r}'.format( |
Contributor
There was a problem hiding this comment.
Sorry for being an uninvited guest, but how about using a cartocolor palette instead?? :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This provides an interface to the in-the-works Analysis API