Giter Club home page Giter Club logo

Comments (7)

jonboydell avatar jonboydell commented on June 12, 2024

development branch for introducing mocks for testing - release_1_2_mocks

from logzio_terraform_client.

jonboydell avatar jonboydell commented on June 12, 2024

@pengux - agree - which functions would you mock? the ones that make the API HTTP calls? or some higher level of abstraction?

from logzio_terraform_client.

pengux avatar pengux commented on June 12, 2024

@jonboydell The whole API can be mocked with a simple HTTP server and httptest which just return fixed test data. The mock can be set to expect a specific request and return the appropriate response for it. This way, the one writing the test can for example inject invalid/valid responses to test against.

from logzio_terraform_client.

jonboydell avatar jonboydell commented on June 12, 2024

thanks @pengux - i thought you meant a mock as in https://github.com/golang/mock - i'm not au fait with httptest will look into it

from logzio_terraform_client.

pengux avatar pengux commented on June 12, 2024

@jonboydell I think something like https://github.com/jarcoal/httpmock is more suitable for mocking APIs

from logzio_terraform_client.

jonboydell avatar jonboydell commented on June 12, 2024

@pengux - didn't see that till just now, have already implemented httptest across the Users part of the lib - going to stick with that for Users but might use the other lib for Endpoints and Alerts and then upgrade - BTW - I am [email protected] - I'd prefer email over Slack ATM, if it doesn't work we can use Slack, but unless you pay for it, it deletes the chat history after 24 hours :(

from logzio_terraform_client.

jonboydell avatar jonboydell commented on June 12, 2024

framework is now in develop, so closing this issue - improvements to test coverage to be tracked as individual issues...

from logzio_terraform_client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.