FYI, a few new testing functions and a package
Tim Penhey
tim.penhey at canonical.com
Fri Aug 2 04:20:48 UTC 2013
On 02/08/13 16:17, Ian Booth wrote:
>>
>> testing.PatchEnvironment
>>
>> This method sets the environment variable with the specified value, and
>> returns a function that will set it back to what it was. Simply used in
>> a test like this:
>>
>> defer coretesting.PatchEnvironment(osenv.JujuLxcBridge, "br0")()
>>
>>
>
> We have something similar in Goose. Which made me wonder what our policy is with
> respect to collecting these sorts of useful utilities and packaging them so that
> they are usable for more than just project X or Y individually. Even within
> juju-core there's duplicated utility code to make up for Go's lack of this or
> that feature. Usable errors is another example of Goose and juju-core solving
> the same problem twice. There would be more as well I'm sure.
>
> Is it worth trying to do something to package this common functionality? Or will
> it be too hard due to Go's lack of dependency versioning? I really am adverse to
> all the DRY violations / duplication in our collective code base.
>
launchpad.net/got ?
go t(esting)
/me shrugs
Makes sense to have common testing package across projects.
Which would make me want to move the checkers into that too.
Tim
More information about the Juju-dev
mailing list