Skip to main content

A mocking library for HappyBase

Project description

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.


To install HappyBase-mock, just do:

pip install happybase-mock


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.


Running Tests

Install test requirements:

pip install -r requirements-test.txt

Then run the test:


Project details

Download files

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

Files for happybase-mock, version 0.8.1
Filename, size File type Python version Upload date Hashes
Filename, size happybase_mock-0.8.1-py2-none-any.whl (8.3 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size happybase-mock-0.8.1.tar.gz (6.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page