juju/juju — pull request #746 by TheMue (2014-09-12 12:36:12+00:00)
Title: New Agent API version for Networker

This PR is the first one in a row of changes for the storage of information about the mode of the Networker (safe or non-safe) during provisioning time as machine job. Later this information will be used by the agent to decide, how the networker has to be started.

It doesn't add a new API method nor changes an existing one. Only the number of possible job values changes. But still, to demonstrate a discussion result regarding the versioning of an API and how to test it. Major idea is to not have one test suite but *smaller ones per method to test* and *compatible version* and to *inject the versions* into it. So once a new method is added or a method changes (e.g. different arguments or return values) a new version of the suite can be implemented and the tests be added only for the new version.

Adding and injecting is then done by calling `gc.Suite()` multiple times for the individual suites together with a constructor for the creation of the APIs. Inside the tests the constructor is called and the result casted to the lowest compatible version. So while here all APIs have V0 (because V1 is compatible) a new suite for a V2 with a new method may cast it to an according V2 instance.

I hope the descriptions helps to understand the intention, it currently is documented with a more visual example.