You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a simple helper to check if i'm logged in to RT or not for unit testing in https://github.com/NCEAS/awards-bot. It's useful for skipping unit tests when not logged in to RT.
It might make more sense for it (or a more elegant version) to live here. Thoughts?
@dmullen17 sorry, just getting back into RT a bit now. @amoeba and I are currently planning to do some package restructuring to get it CRAN-ready. We're trying to maintain matches to the RT API as much as possible, but I see this as a possible way to modularize the connection-checking part of rt_login. Don't have the bandwidth to fully look into this now, but will try to come back to this eventually!
We could certainly include something like this. Can you imagine someone using it in an interactive session though or just in a using-rt-in-another-package scenario like yours? If we think enough users might use it, it might be worth considering.
If most of the utility here can capture the behavior that rt_login's return value could accomplish, I'd probably just stick with rt_login.
For your unit tests, could you just see if the RT_BASE_URL env var is set to detect whether you should try to run the tests?
I think having something like this is probably useful but I didn't like the idea of having to make an HTTP call just to find out whether we're logged in. I'm going to move this off of the 1.0 release as it's not a critical.
If we revisit this in the future, it might be possible to figure out whether we're logged in without making an HTTP call. For example, we could capture the cookies on the rt_login call, store them in the package's state, and query that.
I'm using a simple helper to check if i'm logged in to RT or not for unit testing in https://github.com/NCEAS/awards-bot. It's useful for skipping unit tests when not logged in to RT.
It might make more sense for it (or a more elegant version) to live here. Thoughts?
The text was updated successfully, but these errors were encountered: