Skip to main content

No project description provided

Project description

Mebula is a framework which you can use in your testing code to mock your calls to cloud providers’ APIs. At the moment, Oracle’s OCI, Google Cloud and Microsoft Azure are supported.


  • For Microsoft Azure, install the mebula[azure] package.
  • For Google Cloud, install the mebula[google] package.
  • For Oracle’s OCI, install the mebula[oracle] package.



You can use the mock_azure context manager and then use the Azure functions as normal:

from azure.common.client_factory import get_client_from_json_dict
from azure.mgmt.compute import ComputeManagementClient

from import mock_azure

def test_azure():
    with mock_azure():
        credential = DefaultAzureCredential()
        client = ComputeManagementClient(credential=credential, subscription_id="foo")

        assert list(client.virtual_machines.list("group")) == []


You can use the mock_google context manager and then use the Google API functions as normal:

import googleapiclient.discovery

from mebula import mock_google

def test_google(client):
    with mock_google():
        client ="compute", "v1")

        assert client.instances().list(project="foo", zone="bar").execute() == {}


You can use the mock_oracle context manager and then use the Oracle oci functions as normal:

import oci

from import mock_oracle

def test_oracle():
    with mock_oracle():
        compute = oci.core.ComputeClient(config={})

        assert compute.list_instances("foo").data == []


Coverage is very minimal at the moment. Only launching and listing instances is supported.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mebula-0.2.9.tar.gz (9.4 kB view hashes)

Uploaded source

Built Distribution

mebula-0.2.9-py3-none-any.whl (14.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page