Skip to main content

A mocking library for HappyBase

Project description

https://badge.fury.io/py/happybase-mock.svg https://travis-ci.org/eliangcs/happybase-mock.svg?branch=master https://coveralls.io/repos/eliangcs/happybase-mock/badge.png?branch=master

A mocking library for HappyBase.

Installing HBase is not easy. Running HBase also costs high system resource. This library simulates HappyBase API in local memory, so you don’t have to set up HBase. This is handy if you want to do fast in-memory testing.

Installation

To install HappyBase-mock, just do:

pip install happybase-mock

Usage

The API and package structure of HappyBase-mock is a mimic of HappyBase. They are almost identical, so you can use it like you normally would do in HappyBase.

For example, you can replace happybase package with happybase_mock. Then all of the operations will be performed in memory:

import happybase_mock as happybase

pool = happybase.ConnectionPool(host='localhost', table_prefix='app')
with pool.connection() as conn:
    table = conn.table('table_name')
    table.put('rowkey', {'d:data': 'value'})

TIP: You can also use Mock library to help you patch HappyBase on runtime.

Contribute

Running Tests

Install test requirements:

pip install -r requirements-test.txt

Then run the test:

py.test

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

happybase-mock-0.10.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

happybase_mock-0.10.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file happybase-mock-0.10.0.tar.gz.

File metadata

File hashes

Hashes for happybase-mock-0.10.0.tar.gz
Algorithm Hash digest
SHA256 ebc0026169f2f4456121269524599087fb3f416d2362d824657c4ce8ec2c355e
MD5 32c2d8a9e6e82087874e178e58ea7f94
BLAKE2b-256 13de2493eebd43776710cbdfecb4fd686f7b8e922875c363dd2760e7031071af

See more details on using hashes here.

File details

Details for the file happybase_mock-0.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for happybase_mock-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c91787865c869ac6f5269768a75f5ea0c846162cdd82c5cf3de7aa09ed67c3b
MD5 cf75eae0d2bd1de3f1f1033709cf05f5
BLAKE2b-256 af7d870abb0f1158145fcb96b5ca1a1b6d76ba9a6ec5d06c7fd150fe24f88ec4

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