Code review comment for lp://staging/~jimbaker/pyjuju/expose-status

Revision history for this message
Jim Baker (jimbaker) wrote :

On Fri, Jun 24, 2011 at 7:09 AM, Kapil Thangavelu <
<email address hidden>> wrote:

> Review: Needs Fixing
> It doesn't appear there are any tests for non-exposed services or units
> without open ports.
>

In the test setup, not all services were exposed (only varnish is), and not
every unit opened ports (only wordpress and varnish do). Currently the
status doesn't output information if a service is not exposed (eg "exposed":
false) or if a service unit doesn't have ports open ("open-ports": []). This
was intentional to minimize the output, but certainly could be changed if it
makes more sense.

Consequently, the absence is now being tested explicitly in these tests
because of the use of exact comparison in nearly all assertions. In the two
exceptions, I used assertGreaterEqual in a couple assertions because in this
situation the keys were being extracted for all services, but of course in
the test setup, it's only in varnish that is exposed and would have the
"exposed" key. This assertion should be made exact by removing the loop.

« Back to merge proposal