MCPcopy
hub / github.com/burnash/gspread / test_worksheet_update_index

Method test_worksheet_update_index

tests/worksheet_test.py:1612–1625  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1610
1611 @pytest.mark.vcr()
1612 def test_worksheet_update_index(self):
1613 # need to have multiple worksheets to reorder them
1614 self.spreadsheet.add_worksheet("test_sheet", 100, 100)
1615 self.spreadsheet.add_worksheet("test_sheet 2", 100, 100)
1616
1617 worksheets = self.spreadsheet.worksheets()
1618 last_sheet = worksheets[-1]
1619 self.assertEqual(last_sheet.index, len(worksheets) - 1)
1620
1621 last_sheet.update_index(0)
1622
1623 worksheets = self.spreadsheet.worksheets()
1624 self.assertEqual(worksheets[0].id, last_sheet.id)
1625 self.assertEqual(last_sheet.index, 0)
1626
1627 @pytest.mark.vcr()
1628 def test_worksheet_notes(self):

Callers

nothing calls this directly

Calls 3

add_worksheetMethod · 0.80
worksheetsMethod · 0.80
update_indexMethod · 0.80

Tested by

no test coverage detected