sagemathinc / cocalc-python-api

Python Client for the CoCalc API
Apache License 2.0
1 stars 2 forks source link

Account for testing? #1

Open matthew-brett opened 4 years ago

matthew-brett commented 4 years ago

I'm happy to contribute https://gist.github.com/matthew-brett/6da0d785e74644fd9cc3953a080aa027 here, as I said before. The problem is the tests. At the moment my tests use my account with a private API token. That's not practical for testing generally, obviously. Is there a way of making a restricted cocalc account that is locked down to prevent abusive uploads or email invitations?

haraldschilly commented 4 years ago

I was also thinking about this. I think there are two ways to go. One is to just mock the server, probably not so useful. The other way I can think of is to make all necessary account info and api keys set via environment variables and then we inject this via travis-ci env vars. I can set this up. I don't think it makes sense to restrict any functionality, because these secrets aren't exposed and well, we just have to avoid making "abusive tests", e.g. each new commit creates 1000 projects or whatnot :-)

matthew-brett commented 4 years ago

The problem is though, that we want to make it possible for people to run tests on their own machine. Also, PRs can come from anywhere, and they could do bad things.

matthew-brett commented 4 years ago

Maybe a restricted service, but with the same API?