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)
| File | Size | Uploaded | |
|---|---|---|---|
| fakebigtable-0.1.5.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|