Conversation
| connection = self._get_connection() | ||
| return connection.request(http_method, endpoint)['config'] | ||
|
|
||
| def set_config(self, config): |
Contributor
There was a problem hiding this comment.
Maybe check here if this is a valid dict:
if isinstance(config, six.string_types):
try:
config = json.loads(config)
except (ValueError, TypeError):
raise SyncanoValueError('...')
if not isinstance(config, dict):
raise SyncanoValueError('...')
Contributor
|
One small comment left; LGTM. |
| from tests.integration_test import InstanceMixin, IntegrationTest | ||
|
|
||
|
|
||
| class SnippetConfigTest(InstanceMixin, IntegrationTest): |
Contributor
There was a problem hiding this comment.
Add a test here which check something like this:
- Create config with
some field - Update the config with
new field - Check if
some fieldis still present in config after update.
Contributor
|
PLS merge. |
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.
I tried to create Config model and add 1 to 1 relation between Instance and newly created Config model but I don't know how to do it using existing fields. Anyways, I think that if snippet's global config is really global then it should come with directly in JSON with Instance model.
@opalczynski Please take a look here :)