Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Table): Add 'get_table_from_sheet' option
- Loading branch information
1 parent
ee43e86
commit 5acb909
Showing
4 changed files
with
146 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
google-api-python-client>=1.7.4 | ||
oauth2client>=4.1.2 | ||
pytest | ||
coverage | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import pytest | ||
|
||
from sheetfu import SpreadsheetApp, Table | ||
from tests.utils import mock_google_sheets_responses | ||
|
||
|
||
@pytest.fixture() | ||
def full_spreadsheet(): | ||
http_mocks = mock_google_sheets_responses([ | ||
'table_get_sheets.json', | ||
'table_check_data_range.json', | ||
'table_values.json', | ||
'table_values.json', | ||
'table_notes.json', | ||
'table_backgrounds.json', | ||
'table_font_colors.json' | ||
]) | ||
|
||
return SpreadsheetApp(http=http_mocks) | ||
|
||
|
||
@pytest.fixture() | ||
def spreadsheet(): | ||
http_mocks = mock_google_sheets_responses([ | ||
'table_get_sheets.json', | ||
'table_check_data_range.json', | ||
'table_values.json', | ||
'table_values.json', | ||
'table_commit_reply.json', | ||
'table_commit_reply.json', | ||
'table_commit_reply.json', | ||
]) | ||
|
||
return SpreadsheetApp(http=http_mocks) | ||
|
||
|
||
@pytest.fixture() | ||
def table(spreadsheet): | ||
table_range = spreadsheet.open_by_id('whatever').get_sheet_by_name('Sheet1').get_data_range() | ||
return Table( | ||
full_range=table_range, | ||
notes=False, | ||
backgrounds=False, | ||
font_colors=False | ||
) | ||
|
||
|
||
@pytest.fixture() | ||
def full_table(full_spreadsheet): | ||
table_range = full_spreadsheet.open_by_id('whatever').get_sheet_by_name('Sheet1').get_data_range() | ||
return Table( | ||
full_range=table_range, | ||
notes=True, | ||
backgrounds=True, | ||
font_colors=True | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters