Open
Conversation
symstu
reviewed
May 20, 2020
| db: str, | ||
| revs: bool = None, | ||
| docs: dict = None) -> types.UniversalResponse: | ||
| docs: typing.List[models.Doc], |
Owner
There was a problem hiding this comment.
нужно внимательно смотреть, какие из параметров являются обязательными
symstu
reviewed
May 20, 2020
|
|
||
| if docs: | ||
| json_data['docs'] = f'{docs}' | ||
| json_data['docs'] = [item.dump() for item in docs] |
Owner
There was a problem hiding this comment.
неправильное обьявление json-данных
symstu
reviewed
May 20, 2020
| async def db_bulk_docs(self, | ||
| db: str, | ||
| docs: list = None, | ||
| docs: typing.List[models.ExtendedDoc], |
Owner
There was a problem hiding this comment.
нужно сделать нормальные модели для запросов, если речь идет о POST-запросе
symstu
reviewed
May 20, 2020
| 404: 'Requested database not found' | ||
| }, | ||
| query=query, | ||
| json_data=json_data, |
Owner
There was a problem hiding this comment.
тут вообще поле передачи данных было пропущено
symstu
reviewed
May 20, 2020
Comment on lines
+39
to
+51
| class Doc: | ||
| id: str | ||
| rev: str = None | ||
|
|
||
| def dump(self): | ||
| return {'id': self.id, 'rev': self.rev} | ||
|
|
||
|
|
||
| @dataclass() | ||
| class ExtendedDoc: | ||
| _id: str | ||
| _rev: str = None | ||
| _deleted: bool = None |
Owner
There was a problem hiding this comment.
вот так надо было сделать для этих POST-запросов модели. Еще надо найти готовые или создать ответы для этих же запросов
symstu
reviewed
May 20, 2020
|
|
||
| def test_design_docs(async_run: Callable, client: CouchClient): | ||
| # todo: type of keys is invalid | ||
| response = async_run(client.db_design_docs(db_name, keys=[doc_id])) |
Owner
There was a problem hiding this comment.
тут неправильный тип данных передавался - список против словаря
symstu
reviewed
May 20, 2020
Comment on lines
62
to
71
| def __test_bulk_get(async_run: Callable, client: CouchClient): | ||
| docs = [db_models.Doc(id=doc_id)] | ||
| response = async_run(client.db_bulk_get(db_name, docs=docs)) | ||
| assert response.status_code == 200 | ||
|
|
||
|
|
||
| #def test_bulk_docs(async_run: Callable, client: CouchClient): | ||
| #response = async_run(client.db_bulk_docs(db_name, docs=[doc_id])) | ||
| #assert response.status_code == 200 | ||
| def test_bulk_docs(async_run: Callable, client: CouchClient): | ||
| docs = [db_models.ExtendedDoc(_id=doc_id)] | ||
| response = async_run(client.db_bulk_docs(db_name, docs=docs)) | ||
| assert response.status_code == 200 |
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.
No description provided.