On 31 October 2013 05:21, Andrew Wilkins <[email protected]> wrote:
> Does anybody object to converting the public entity structs in state to
> interfaces? i.e. State, Machine, Unit, etc.
>
> I'd like to write some tests for new code that depends on state. Setting up
> mongo and so on is overkill. and should be relegated to integration testing.
If State was an interface, it alone would have 45 methods, not
counting 190 more in Machine, Unit, etc; this seems really quite unwieldy.
It certainly wouldn't be easy to implement a mock implementation without using
the original.
Without knowing more about your particular problem I can't say
much more, but John's suggestion seems sound and is one I've
been using recently (see worker/addressupdater for example) -
inventing ad hoc interfaces that describe the local needs of the importer,
rather than providing giant interfaces that try to be all things to
all users.
cheers,
rog.
--
Juju-dev mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/juju-dev