Skip to main content
Help us improve Python packaging – donate today!

A mocking library for HappyBase

Project Description

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

Release history Release notifications

This version
History Node

0.9.0

History Node

0.8.2

History Node

0.8.1

History Node

0.8.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
happybase_mock-0.9.0-py3-none-any.whl (8.8 kB) Copy SHA256 hash SHA256 Wheel 3.6 Feb 28, 2017
happybase-mock-0.9.0.tar.gz (7.2 kB) Copy SHA256 hash SHA256 Source None Feb 28, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page