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.
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
Built Distribution
File details
Details for the file happybase-mock-0.10.0.tar.gz
.
File metadata
- Download URL: happybase-mock-0.10.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebc0026169f2f4456121269524599087fb3f416d2362d824657c4ce8ec2c355e |
|
MD5 | 32c2d8a9e6e82087874e178e58ea7f94 |
|
BLAKE2b-256 | 13de2493eebd43776710cbdfecb4fd686f7b8e922875c363dd2760e7031071af |
File details
Details for the file happybase_mock-0.10.0-py3-none-any.whl
.
File metadata
- Download URL: happybase_mock-0.10.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c91787865c869ac6f5269768a75f5ea0c846162cdd82c5cf3de7aa09ed67c3b |
|
MD5 | cf75eae0d2bd1de3f1f1033709cf05f5 |
|
BLAKE2b-256 | af7d870abb0f1158145fcb96b5ca1a1b6d76ba9a6ec5d06c7fd150fe24f88ec4 |