Testing api clients

Jesse Meek jesse.meek at canonical.com
Thu Sep 11 22:08:48 UTC 2014


Last week I added PatchClientFacadeCall to api/export_test.go which does 
the same thing: https://github.com/juju/juju/blob/master/api/export_test.go
It is used in several tests, e.g. TestShareEnvironmentExistingUser

On 11/09/14 22:30, Matthew Williams wrote:
> Thanks Andrew,
>
> I was almost about to reimplement this myself - making use of it right now
>
> Thanks
>
> Matty
>
> On Thu, Sep 11, 2014 at 5:57 AM, Andrew Wilkins 
> <andrew.wilkins at canonical.com <mailto:andrew.wilkins at canonical.com>> 
> wrote:
>
>     Hi folks,
>
>     I'd like to bring a small, recent addition to everyone's attention:
>     https://github.com/juju/juju/blob/master/api/base/testing/patch.go
>
>     PatchFacadeCaller can be used (and is used now in several places)
>     to avoid calling through to a real API server in api tests.
>     Ideally we'd just provide mock FacadeCallers to begin with, but
>     this alleviates some of the pain between now and when we do that
>     across all the existing tests.
>
>     If you're writing tests for api clients, please consider using
>     PatchFacadeCaller or a mock FacadeCaller, so we can improve test
>     coverage and avoid slow tests.
>
>     Cheers,
>     Andrew
>
>     --
>     Juju-dev mailing list
>     Juju-dev at lists.ubuntu.com <mailto:Juju-dev at lists.ubuntu.com>
>     Modify settings or unsubscribe at:
>     https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140912/4cbb73c1/attachment.html>


More information about the Juju-dev mailing list