Skip to main content

fakebigtable

A mock implementation of Google Cloud Bigtable client for testing for when the overhead of using the emulator is too much for a small project. Unit tests are written to prove emulator parity. We use the emulator so you don't have to.

Install

pip install fakebigtable

Usage with pytest

import pytest
from google.cloud import bigtable
from fakebigtable import FakeBigtableClient

@pytest.fixture(autouse=True)
def mock_bigtable(monkeypatch):
    monkeypatch.setattr(bigtable, "Client", FakeBigtableClient)

def test_bigtable_operations():
    client = bigtable.Client(project="test-project")
    instance = client.instance("test-instance")
    table = instance.table("test-table")
    # Perform operations on table

Usage with unittest

import unittest
from unittest.mock import patch
from google.cloud import bigtable
from fakebigtable import FakeBigtableClient

class TestBigtableOperations(unittest.TestCase):
    @patch('google.cloud.bigtable.Client', FakeBigtableClient)
    def test_bigtable_operations(self):
        client = bigtable.Client(project="test-project")
        instance = client.instance("test-instance")
        table = instance.table("test-table")
        # Perform operations on table

Metadata

Release files for fakebigtable 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fakebigtable 0.1.5
File Size Uploaded
fakebigtable-0.1.5.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fakebigtable 0.1.5
File Interpreter ABI Platform
fakebigtable-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / fakebigtable-0.1.5.tar.gz

Download URL fakebigtable-0.1.5.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dd45d11a485efbec3690a1ea92ef54707ac50cd12c5a599e34a2af68f6d38bef
BLAKE2b-256 checksum
How to use checksums
4559023dd28e454955850c8bab6270efbf6acef160417bc8396c4eec254ba238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Windows/10

Release files / fakebigtable-0.1.5-py3-none-any.whl

Download URL fakebigtable-0.1.5-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24aa822c79511726c3d406dea98ee7892ff7eb8abd48743cf64e14b6d909d741
BLAKE2b-256 checksum
How to use checksums
e3481ab7bdafa3c7e626ff3dcc270742557f9af4e54ea684a536d1b005a86d84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Windows/10

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page