Skip to content

Add crud test for nested objects#399

Merged
Mec-iS merged 1 commit intoHTTP-APIs:developfrom
vddesai1871:test_nested
Jun 6, 2019
Merged

Add crud test for nested objects#399
Mec-iS merged 1 commit intoHTTP-APIs:developfrom
vddesai1871:test_nested

Conversation

@vddesai1871
Copy link
Copy Markdown
Contributor

Fixes #375

Checklist

  • My branch is up-to-date with upstream/develop branch.
  • Everything works and tested for Python 3.5.2 and above.

Description

Change logs

Added test for nested objects
Adapt tests to use UUIDs
Corrected mypy type annotation in crud.py

Copy link
Copy Markdown
Member

@xadahiya xadahiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread hydrus/tests/test_crud.py
self.doc_collection_classes), self.doc)
id_ = "1"
id_ = str(uuid.uuid4())
insert_response = crud.insert(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this insert out of the try catch block?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first insert is a normal insert with a unique ID and the other one in the try block is redundant (using already used id, which is supposed to fail).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have also changed the name of this test to make it more clear.

Copy link
Copy Markdown
Contributor

@gustavodemorais gustavodemorais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good 👍

@xadahiya
Copy link
Copy Markdown
Member

xadahiya commented Jun 6, 2019

@chrizandr is it okay to merge?

@Mec-iS Mec-iS merged commit c388e1c into HTTP-APIs:develop Jun 6, 2019
Mec-iS added a commit that referenced this pull request Jul 7, 2019
* Extend collection test to validate member item URI (#398)
* Adding DELETE operation to drone collection
* English typos
* Maintaining examples synchronized
* Add crud test for nested objects and refactor other tests (#399)
* Use HydraStatus and HydraError to return status response
* Add a helper function to apply filtering.
* Add helper function to create IriTemplates.
* Use iri_template generator and attach generated iri_template to the colection response.
* Implement searching
* Add support for pagination of search results.
* Add function to include mappings for properties of nested classes in IriTemplate
* Add support for search over nested property values
* Add tests for IriTemplates generated by hydrus.
* Add test for searching mechanism(get_collection())
* Refactor by adding functions for parameter parsing and calculating page limit and offset
* Refactor code by removing redundant check based on value of path variable
* Add exception handling for invalid parameters
chrizandr pushed a commit that referenced this pull request Jul 19, 2019
* Extend collection test to validate member item URI (#398)

* Adding DELETE operation to drone collection

* English typos

* Maintaining examples synchronized

* Add crud test for nested objects and refactor other tests (#399)

* Use HydraStatus and HydraError to return status response

* Add a helper function to apply filtering.

* Add helper function to create IriTemplates.

* Use iri_template generator and attach generated iri_template to the colection response.

* Implement searching

* Add support for pagination of search results.

* Add function to include mappings for properties of nested classes in IriTemplate

* Add support for search over nested property values

* Add tests for IriTemplates generated by hydrus.

* Add test for searching mechanism(get_collection())

* Refactor by adding functions for parameter parsing and calculating page limit and offset

* Refactor code by removing redundant check based on value of path variable

* Add exception handling for invalid parameters

* Add mechanism to support client-controlled pagination (#409)

* Add helper function to attach pagination related mappings to the IriTemplate
* Add an exception to handle incomaptible parameters
* Add mechanism to handle client-guided pagination
* Refactor code and add exception for out of range offset value.
* Add tests for client controlled pagination.
* Debug test_pep8.py and make codebase pep8 compatible.

* Update hydrus with latest changes made at core (#411)

* Update hydrus to use updated core and adapt code accordingly.

* Update tests and add test for readable properties.

* Bump version to 0.2.6
chrizandr added a commit that referenced this pull request Aug 16, 2019
* Extend collection test to validate member item URI (#398)

* Adding DELETE operation to drone collection

* English typos

* Maintaining examples synchronized

* Add crud test for nested objects and refactor other tests (#399)

* Use HydraStatus and HydraError to return status response

* Add a helper function to apply filtering.

* Add helper function to create IriTemplates.

* Use iri_template generator and attach generated iri_template to the colection response.

* Implement searching

* Add support for pagination of search results.

* Add function to include mappings for properties of nested classes in IriTemplate

* Add support for search over nested property values

* Add tests for IriTemplates generated by hydrus.

* Add test for searching mechanism(get_collection())

* Refactor by adding functions for parameter parsing and calculating page limit and offset

* Refactor code by removing redundant check based on value of path variable

* Add exception handling for invalid parameters

* Add mechanism to support client-controlled pagination (#409)

* Add helper function to attach pagination related mappings to the IriTemplate
* Add an exception to handle incomaptible parameters
* Add mechanism to handle client-guided pagination
* Refactor code and add exception for out of range offset value.
* Add tests for client controlled pagination.
* Debug test_pep8.py and make codebase pep8 compatible.

* Update hydrus with latest changes made at core (#411)

* Update hydrus to use updated core and adapt code accordingly.

* Update tests and add test for readable properties.

* Bump version to 0.2.6

* Refactor crud.insert and create new file for other helper functions.

* Add basic socket connection functionality to hydrus.

* Add socketio update event for synchronization.

* Add an endpoint for modification-table-diff.

* Refactor some code and add inline comments.

* Rename new_job_id field in response to job_id.

* Add support to propagate multiple_delete modifications.

* Add sync functionality for PUT and refactor code.

* Add a thread to do routine cleanup of modification records.

* Refactor 'modification-table endpoint' code.

* Add tests for sync updates and modification-table.

* Send an empty response with status-code 204 for outdated clients.

* Use socketio event to send modification-table-diff.

* Add reconnect event and extend tests.

* Refactor and add comments.

* Remove uuid and timestamp, and use incremental ids instead.

* Use incremental job_id instead of timestamp to clean stale records.

* Remove unused imports.

* Use HydraLink to improve handling of nested object props.

* Add links as GraphIII triples instead of GraphIIT triples.

* Add link_prop to assist insertion of linked properties as GraphIII.

* Adapt test for nested fields defined with hydra:Link.

* Refactor insertion of GraphIII triples for link properties.

* Add explicit type check for link properties.

* Use latest hydra-python-core from the master branch.
xadahiya added a commit that referenced this pull request Aug 16, 2019
* Extend collection test to validate member item URI (#398)

* Adding DELETE operation to drone collection

* English typos

* Maintaining examples synchronized

* Add crud test for nested objects and refactor other tests (#399)

* Use HydraStatus and HydraError to return status response

* Add a helper function to apply filtering.

* Add helper function to create IriTemplates.

* Use iri_template generator and attach generated iri_template to the colection response.

* Implement searching

* Add support for pagination of search results.

* Add function to include mappings for properties of nested classes in IriTemplate

* Add support for search over nested property values

* Add tests for IriTemplates generated by hydrus.

* Add test for searching mechanism(get_collection())

* Refactor by adding functions for parameter parsing and calculating page limit and offset

* Refactor code by removing redundant check based on value of path variable

* Add exception handling for invalid parameters

* Add mechanism to support client-controlled pagination (#409)

* Add helper function to attach pagination related mappings to the IriTemplate
* Add an exception to handle incomaptible parameters
* Add mechanism to handle client-guided pagination
* Refactor code and add exception for out of range offset value.
* Add tests for client controlled pagination.
* Debug test_pep8.py and make codebase pep8 compatible.

* Update hydrus with latest changes made at core (#411)

* Update hydrus to use updated core and adapt code accordingly.

* Update tests and add test for readable properties.

* Bump version to 0.2.6

* Refactor crud.insert and create new file for other helper functions.

* Add basic socket connection functionality to hydrus.

* Add socketio update event for synchronization.

* Add an endpoint for modification-table-diff.

* Refactor some code and add inline comments.

* Rename new_job_id field in response to job_id.

* Add support to propagate multiple_delete modifications.

* Add sync functionality for PUT and refactor code.

* Add a thread to do routine cleanup of modification records.

* Refactor 'modification-table endpoint' code.

* Add tests for sync updates and modification-table.

* Send an empty response with status-code 204 for outdated clients.

* Use socketio event to send modification-table-diff.

* Add reconnect event and extend tests.

* Refactor and add comments.

* Remove uuid and timestamp, and use incremental ids instead.

* Use incremental job_id instead of timestamp to clean stale records.

* Remove unused imports.

* Use HydraLink to improve handling of nested object props.

* Add links as GraphIII triples instead of GraphIIT triples.

* Add link_prop to assist insertion of linked properties as GraphIII.

* Adapt test for nested fields defined with hydra:Link.

* Refactor insertion of GraphIII triples for link properties.

* Add explicit type check for link properties.

* Use latest hydra-python-core from the master branch.

* Version bump to 0.3.0

* Update hydra-python-core branch to master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants