Git Product home page Git Product logo

drivetestbed's Introduction

drivetestbed

Drive TestBed is a mock Google Drive API implementation that actually "works".

You construct Drive service calls as you normally would using the Python client but instead of making calls to an actual gdocs domain they are routed to a local in-memory database of documents and permissions.

This allows you to test the side effects of a Drive app without having to be connected to a gdocs domain and with much greater performance, since there is no http overhead.

Conceptually, this is modeled on the App Engine Testbed provided with Google App Engine.

Services supported

Currently the following services are at some stage of support:

  • Files
  • Permissions
  • Parents

Integrating into your tests

The drive testbed works by replacing the Http connection to the Drive service. The easiest way to set this up is to substitute the testbed http when building the service using the discovery API. For example:

from apiclient.discovery import build

service = build('drive', 'v2', http.TestbedHttp())

Then you can use the service in the normal way:

response = service.files().list().execute()

Dependencies

Need to put together a build with requirements.txt Until then, you need:

pip install routes
pip install google-api-python-client

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.