def testConstructor(self): flexmock(helper_functions) \ .should_receive('read_file') \ .and_return('127.0.0.1') flexmock(thriftclient).should_receive("ThriftClient") \ .and_return(FakeHypertableClient()) db = hypertable_interface.DatastoreProxy()
def testRangeQuery(self): flexmock(helper_functions) \ .should_receive('read_file') \ .and_return('127.0.0.1') flexmock(thriftclient).should_receive("ThriftClient") \ .and_return(FakeHypertableClient()) db = hypertable_interface.DatastoreProxy() assert [] == db.range_query("table", [], "start", "end", 0)
def testDelete(self): flexmock(helper_functions) \ .should_receive('read_file') \ .and_return('127.0.0.1') flexmock(thriftclient).should_receive("ThriftClient") \ .and_return(FakeHypertableClient()) db = hypertable_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(thriftclient).should_receive("ThriftClient") \ .and_return(FakeHypertableClient()) db = hypertable_interface.DatastoreProxy() # Make sure no exception is thrown assert None == db.batch_put_entity('table', [], [], {})
def setUp(self): self.dbstore = hypertable_interface.DatastoreProxy() self.dbstore.delete_table(TEST3_TABLE) self.dbstore.create_table(TEST3_TABLE, TEST3_TABLE_SCHEMA)