On 10 April 2016 at 22:31, Pete Vander Giessen <[email protected]> wrote: > Hello All, > > I'm currently working on writing a layered charm, and I had a question about > unit (or unit-ish) testing. Is it practical to write unit test for, say, > helpers for a reactive handler? Does anybody have any favorite examples they > can point me at? > > There's a lot of awesome automagic in a juju charm, but I'm having a little > trouble setting up paths and environments with that magic mocked out for > unit-style tests. :-/ > > (The reason I'm trying to write smaller tests is that I'd like to speed up > my testing cycle while I'm still in the obvious mistakes and silly typos > stage of writing the charm)
https://git.launchpad.net/postgresql-charm has both unit and integration tests. https://git.launchpad.net/postgresql-charm/tree/tests/test_postgresql.py are the bulk of the unit tests, testing the helpers in reactive/postgresql/postgresql.py. -- Stuart Bishop <[email protected]> -- Juju mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju
