Comments (4)
@jarhill0 Do you have any idea on how to fix this, since you mostly did the corresponding implementation in #95?
from pycaching.
Hmm, I don't really know, sorry. It's been a while since I made that change and I haven't been closely involved in this project for quite some time
from pycaching.
@jarhill0 No big deal, I just thought you might have an idea here why the replacement logic seems to act wrong. Thanks for your answer anyway.
from pycaching.
I was getting some errors (401 Client Error: Unauthorized for url: …
) while recording cassettes, so I managed to find a workaround. Seems like Betamax doesn't send all cookies — the most important one (gspkauth
) isn't sent in the request.
My solution was quite simple — I added this piece into every test which needed recording a cassette:
import requests
self.gc._session.cookies.set_cookie(
requests.cookies.create_cookie(
name="gspkauth",
value="TOKEN_VALUE",
)
)
Example:
def test_something(self):
import requests
self.gc._session.cookies.set_cookie(
requests.cookies.create_cookie(
name="gspkauth",
value="TOKEN_VALUE",
)
)
with self.recorder.use_cassette("some_cassette"):
cache = self.gc._try_getting_cache_from_guid("cache_guid")
self.assertEqual("cache_name", cache.name)
This is mostly a note for me, so I wouldn't need to find the workaround again 😄
from pycaching.
Related Issues (20)
- Duplicated functions (`Cache._from_print_page()` & `Cache.load_by_guid()`) HOT 1
- searching my_owned HOT 1
- Problems with date parsing HOT 2
- [API] Sorting doesn't work anymore HOT 3
- `http.client.RemoteDisconnected` when running for a longer time HOT 3
- `Cache.load_quick()` doesn't work for non-active Geocaches HOT 1
- pycaching.cache.Cache._from_print_page not working with non-English languages HOT 1
- get_cache(guid=) raising page load error HOT 1
- No attribute for getting the name of a cache HOT 1
- I'm not sure how to translate a cache.Type value into a str. HOT 1
- Access Geocaching Messaging Feature HOT 1
- What type does cache.load_logbook() return and how do I turn it into a dict? HOT 3
- No current way to get the raw HTML cache description HOT 5
- Get all the images from a cache's image gallery
- Delete or Edit Log Posts HOT 1
- pycaching.geocaching.search() function not working properly HOT 13
- advanced_search() returning unexpected results when searching for a string HOT 9
- Document release process
- Enable squash merging? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycaching.