def testConstructor(self): flexmock(helper_functions) \ .should_receive('read_file') \ .and_return('127.0.0.1') flexmock(hbase_interface.DatastoreProxy).should_receive("create_connection") \ .and_return(FakeHBaseClient()) db = hbase_interface.DatastoreProxy()
def testRangeQuery(self): flexmock(helper_functions) \ .should_receive('read_file') \ .and_return('127.0.0.1') flexmock(hbase_interface.DatastoreProxy).should_receive("create_connection") \ .and_return(FakeHBaseClient()) db = hbase_interface.DatastoreProxy() assert [] == db.range_query("table", [], "start", "end", 0)
def create_app_tables(): """ Creates application tables for AppScale """ db = hbase_interface.DatastoreProxy() db.create_table(ASC_PROPERTY_TABLE, PROPERTY_SCHEMA) db.create_table(DSC_PROPERTY_TABLE, PROPERTY_SCHEMA) db.create_table(APP_INDEX_TABLE, APP_INDEX_SCHEMA) db.create_table(APP_NAMESPACE_TABLE, APP_NAMESPACE_SCHEMA) db.create_table(APP_ID_TABLE, APP_ID_SCHEMA) db.create_table(APP_ENTITY_TABLE, APP_ENTITY_SCHEMA) db.create_table(APP_KIND_TABLE, APP_KIND_SCHEMA)
def testDelete(self): flexmock(helper_functions) \ .should_receive('read_file') \ .and_return('127.0.0.1') flexmock(hbase_interface.DatastoreProxy).should_receive("create_connection") \ .and_return(FakeHBaseClient()) db = hbase_interface.DatastoreProxy() # Make sure no exception is thrown assert None == db.batch_delete('table', [])
def testPut(self): flexmock(file_io) \ .should_receive('read') \ .and_return('127.0.0.1') flexmock(hbase_interface.DatastoreProxy).should_receive("create_connection") \ .and_return(FakeHBaseClient()) db = hbase_interface.DatastoreProxy() # Make sure no exception is thrown assert None == db.batch_put_entity('table', [], [], {})
def create_app_tables(): """ Creates application tables for AppScale. """ db_store = hbase_interface.DatastoreProxy() db_store.create_table(dbconstants.ASC_PROPERTY_TABLE, dbconstants.PROPERTY_SCHEMA) db_store.create_table(dbconstants.DSC_PROPERTY_TABLE, dbconstants.PROPERTY_SCHEMA) db_store.create_table(dbconstants.APP_ID_TABLE, dbconstants.APP_ID_SCHEMA) db_store.create_table(dbconstants.APP_ENTITY_TABLE, dbconstants.APP_ENTITY_SCHEMA) db_store.create_table(dbconstants.APP_KIND_TABLE, dbconstants.APP_KIND_SCHEMA) db_store.create_table(dbconstants.JOURNAL_TABLE, dbconstants.JOURNAL_SCHEMA)