Пример #1
0
    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()
Пример #2
0
    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)
Пример #3
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', [], [], {})
Пример #5
0
 def setUp(self):
     self.dbstore = hypertable_interface.DatastoreProxy()
     self.dbstore.delete_table(TEST3_TABLE)
     self.dbstore.create_table(TEST3_TABLE, TEST3_TABLE_SCHEMA)