Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface for creating and testing Cells #360

Closed
samzhang111 opened this issue Feb 26, 2016 · 2 comments
Closed

Interface for creating and testing Cells #360

samzhang111 opened this issue Feb 26, 2016 · 2 comments

Comments

@samzhang111
Copy link

I've been trying to write tests that wrap around gspread for a project that is trying to sync pandas dataframes with google sheets (https://github.com/samzhang111/pandasheets).

So far, Cells have been hard to test for a few reasons:

  • They cannot be constructed without also constructing an xml etree element.
    • They have no basis from which to compare equality

I've created a set of convenience methods for myself to test them but this feels like a stretch. https://github.com/samzhang111/pandasheets/blob/master/test/helpers/cell_helpers.py

Can we extend Cell to help construct the xml element inside of it?

@Ralithune
Copy link

Sometimes I think I'm a pretty decent Python programmer, until I come to github and see projects like Gspread here and your additions, Samzhang111.

I'm interested in this because update_cell() in gspread is ungodly slow - I'd like to use update_cellS(), but I don't want to first get a range of them from a sheet - I want to create them and push them to the sheet authoritatively, IE, I don't care what's there already, just overwrite it.

That means creating the Cell objects from scratch, and I'm running in to the issue of not having an XML etree element (I don't even know what that is).

I looked at your code, and from what I can tell you're going through some gymnastics to fill in necessary pieces of the ElementTree object, but there's one thing, "MagicMock()" I don't see a source for.

Would anyone be willing to help a never-formally-trained-guy out?

@burnash
Copy link
Owner

burnash commented Mar 13, 2020

Sorry for the late response and thank you for the suggestion. I'm afraid this issue is not relevant anymore since gspread is using only API v4 since #536.
I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants