def test_init_developer_key(mocker): sheets = gsheets.Sheets(developer_key=mocker.sentinel.developer_key) assert isinstance(sheets, gsheets.Sheets) assert sheets._creds is None assert sheets._developer_key == mocker.sentinel.developer_key
def sheets(mocker): return gsheets.Sheets(credentials=mocker.sentinel.credentials)
def test_init_fail(): with pytest.raises(ValueError): gsheets.Sheets()
def sheet(spreadsheet_values): id = spreadsheet_values['spreadsheet']['spreadsheetId'] yield gsheets.Sheets(credentials=None)[id]
def sheet(mocker, spreadsheet_values): id = spreadsheet_values['spreadsheet']['spreadsheetId'] yield gsheets.Sheets(credentials=mocker.sentinel.credentials)[id]
def sheets(): return gsheets.Sheets(credentials=None)
def test_key(): sheets = gsheets.Sheets(developer_key='key') assert isinstance(sheets, gsheets.Sheets) assert sheets._key == 'key'