thomluther / anker-solix-api

Python library for Anker Solix API
MIT License
38 stars 12 forks source link

test: reactivate commented test #47

Closed stuertz closed 4 months ago

stuertz commented 4 months ago

Ah ok, didn't know your intention.

The file is still there: https://github.com/thomluther/anker-solix-api/blob/main/test_api.py

I wanted to reenable the code in it. to keep it as a working example. That script could have become a starting point to implement automated pytests.

API Request limiting may become a point, I agree.

The script could be nice to dig into the API and for debugging purposes. None must execute it, just because it is there... But I'm ok if you go to throw it away....

stuertz commented 4 months ago

BTW: I did hit rate limits with energy_csv.py ;-)

thomluther commented 4 months ago

I'm not necessarily want to throw it away if you want to update the master module with more common examples or better structure. My point is just that we shuold only finalize a single new master version with most of the stuff commented, so that if someone want to use it to explore the Api, he must uncomment (and modify) the requests or endpoints that he wants to test. It is not meant to be a base for an automated test routine of the api. If you want to create something for that, I would say this should go into a separate script.

stuertz commented 4 months ago

Regarding pytests, yes that belongs to another place. - I totally agreed This just reflects my journey into the api. ;-)

At first I wanted to repair the example code and i personally dislike commented code, because it rots quite fast. I'll restructure it and give it another try, that maybe fits your ideas a bit more.