[Pulp-list] Unit Test Notes

Jay Dobies jason.dobies at redhat.com
Thu Jun 14 11:40:26 UTC 2012


On 06/13/2012 10:26 PM, Nick Coghlan wrote:
> On 06/13/2012 11:53 PM, Jay Dobies wrote:
>> PulpClientTests - Ignores the database completely. In the setUp call it
>> will populate a test client context for use in the test, mocking out the
>> server and setting up a Recorder instance for the prompt to capture
>> anything the prompt would have output to the screen and make it
>> available for assertions.
>
> How public is this API?
>
> Currently, the pulpdist CLI and web UI tests are using a real Pulp
> server instance and a very permissive mock object (respectively). They
> could likely both be simplified a great deal given a supported mock
> server API to test against.
>
> Cheers,
> Nick.

I still haven't totally figured out what to do with this. All three 
subprojects within Pulp are using it so for now it's copied and pasted 
until I figure out a good central location for it. I figure any 
extension writer would likely want to use it as well; it's not 
impossible to set up a testing client context but it'd be a lot nicer if 
it was provided.

That said, don't expect this to be all that terribly flushed out. When I 
redesigned the bindings I made it easier to slip in a mock at the 
deepest level of the calls (the actual HTTPS connection) so what I've 
been doing is configuring that mock with the HTTP status code and body I 
want to simulate. So it may be less of you wanting to use this base 
class as it is you wanting to use our latest bindings you'll get when 
you upgrade to a more recent version (I'd aim for the planned July 9 CR, 
that's probably a good time to upgrade if you haven't recently).


-- 
Jay Dobies
Freenode: jdob @ #pulp
http://pulpproject.org | http://blog.pulpproject.org




More information about the Pulp-list mailing list