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.

Installation

  • 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.

Usage

Azure

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 mebula.azure 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")) == []

Google

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 = googleapiclient.discovery.build("compute", "v1")

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

Oracle

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

import oci

from mebula.oracle import mock_oracle


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

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

Coverage

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.10.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

mebula-0.2.10-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file mebula-0.2.10.tar.gz.

File metadata

  • Download URL: mebula-0.2.10.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.0 CPython/3.12.2 Linux/6.2.0-1019-azure

File hashes

Hashes for mebula-0.2.10.tar.gz
Algorithm Hash digest
SHA256 7c98ef4e8039ab909f84d3ea91f35d6b37fe647ff6269ff881871338957898ff
MD5 299f2b1a5ad1322e0d29959f5c9cdc74
BLAKE2b-256 3be679ea949c2f8232c553965540f1a310c8189ba4c169a20c3f325c1d992a18

See more details on using hashes here.

File details

Details for the file mebula-0.2.10-py3-none-any.whl.

File metadata

  • Download URL: mebula-0.2.10-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.0 CPython/3.12.2 Linux/6.2.0-1019-azure

File hashes

Hashes for mebula-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 af3b08aa1629df574538252aeba0a54c6fdade14a72ae25d9e42e7ae1a6bb74f
MD5 a66144f8f7c2704932c2f58e6df631f3
BLAKE2b-256 4a6bb6d2644d4570c03173ff29558e98c2f5fc01876d67ad2479c1267d8e7e12

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page