I haven't used the openstack side of things in particular much, but the
general pattern in fog is to use the create methods to populate the mocks.
So if you have mock on and create some resources, then call list_resources,
they should be included. Hope that helps, but if not somebody with more
specific knowledge around this may be able to chime in.


On Mon, Apr 25, 2016 at 8:22 AM, Dave Johnston <[email protected]> wrote:

> Hi,
>
> I've been trying to write some tests for code that uses the
> Fog::Orchestration::Openstack class.
>
> I call a request method called 'list_resources'.  The Mock for this
> request looks like this:
> class Mock
>     def list_resources(options = {}, options_deprecated = {})
>         resources = self.data[:resources].values
>
>         Excon::Response.new(
>           :body   => { 'resources' => resources },
>           :status => 200
>         )
>     end
> end
>
>
> The tests fail because self.data[:resources] is nil.  Does the Fog mock
> framework provide a mechanism to populate the 'data' hash prior to
> executing the test?
>
> --
> You received this message because you are subscribed to the Google Groups
> "ruby-fog" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to