I'm trying to write a mox test that reads a spreadsheet (4 columns), gets the feed and writes specific columns (2 columns) to a CSV file. I'm trying to get past the first step which is get the list feed, my code is as follows:
class SpreadsheetReader(mox.MoxTestBase):
def setUp(self):
mox.MoxTestBase.setUp(self)
self.mock_gclient = self.mox.CreateMock(
gdata.spreadsheet.service.SpreadsheetsService)
self.mock_spreadsheet_key = 'fake_spreadsheet_key'
self.mock_worksheet_id = 'default'
self.test_data = [{'str_col':'col1', 'str_col':'col2', 'str_col':'col13'}]
def testGetFeed(self):
self.mock_gclient.GetListFeed(self.mock_spreadsheet_key,
self.mock_worksheet_id).AndReturn(self.test_data)
self.mox.ReplayAll()
self.mox.Verify()
def tearDown(self):
mox.MoxTestBase.tearDown(self)
When i run this I get the following error:
ExpectedMethodCallsError: Verify: Expected methods never called:
0. SpreadsheetsService.GetListFeed('fake_spreadsheet_key', 'default') -> [{'str_col': 'col13'}]
Any idea how to fix this error?