Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests for the HyperTransport #16

Open
cmbrandenburg opened this issue Mar 22, 2016 · 5 comments
Open

Unit tests for the HyperTransport #16

cmbrandenburg opened this issue Mar 22, 2016 · 5 comments

Comments

@cmbrandenburg
Copy link
Collaborator

The HyperTransport is tested indirectly, via the integration tests. Consider writing unit tests for it to ensure all cases are covered.

@jgillich
Copy link
Contributor

A bit OT, but: did you consider moving the transport into a separate crate, like a micro framework for API clients? The way it abstracts hyper from the actions is really cool (and I'm going to write quite a few clients in the future, that's why I'm asking 😉).

@cmbrandenburg
Copy link
Collaborator Author

@jgillich No, I haven't considered it, but I like the idea. What do you have in mind?

The main hurdle I see is that the Chill transport is tailored for CouchDB and doesn't extend to other applications. For example, see the with_revision_query. That method makes sense only in the context of CouchDB. How do we generalize the transport into a micro-framework useful for other APIs?

@jgillich
Copy link
Contributor

I haven't entirely thought this through yet, but revision is a query parameter, right? You could assume standard HTTP types like query parameters and headers, which the transport could then use those to and construct a HTTP/WS/HTCPCP request or parse them right away for testing.

But I have to think about that for while, there probably is a better way.

@cmbrandenburg
Copy link
Collaborator Author

@jgillich I'm on board with the general idea. Any code in Chill that isn't fundamental to CouchDB is better off existing in another crate. However, I've got higher priorities and don't foresee working on this anytime soon. Feel free to take ownership of the idea and make it happen!

@cmbrandenburg
Copy link
Collaborator Author

@jgillich I opened #51, which, if it works out, might make the transport layer amenable to being separated into its own crate. It remains to be seen how useful such a “micro-framework” would be to other client-side HTTP libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants